summaryrefslogtreecommitdiffstats
path: root/src/cmd/cover/testdata/pkgcfg/a
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:25:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:25:22 +0000
commitf6ad4dcef54c5ce997a4bad5a6d86de229015700 (patch)
tree7cfa4e31ace5c2bd95c72b154d15af494b2bcbef /src/cmd/cover/testdata/pkgcfg/a
parentInitial commit. (diff)
downloadgolang-1.22-f6ad4dcef54c5ce997a4bad5a6d86de229015700.tar.xz
golang-1.22-f6ad4dcef54c5ce997a4bad5a6d86de229015700.zip
Adding upstream version 1.22.1.upstream/1.22.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/cmd/cover/testdata/pkgcfg/a')
-rw-r--r--src/cmd/cover/testdata/pkgcfg/a/a.go28
-rw-r--r--src/cmd/cover/testdata/pkgcfg/a/a2.go8
-rw-r--r--src/cmd/cover/testdata/pkgcfg/a/a_test.go14
3 files changed, 50 insertions, 0 deletions
diff --git a/src/cmd/cover/testdata/pkgcfg/a/a.go b/src/cmd/cover/testdata/pkgcfg/a/a.go
new file mode 100644
index 0000000..44c380b
--- /dev/null
+++ b/src/cmd/cover/testdata/pkgcfg/a/a.go
@@ -0,0 +1,28 @@
+package a
+
+type Atyp int
+
+func (ap *Atyp) Set(q int) {
+ *ap = Atyp(q)
+}
+
+func (ap Atyp) Get() int {
+ inter := func(q Atyp) int {
+ return int(q)
+ }
+ return inter(ap)
+}
+
+var afunc = func(x int) int {
+ return x + 1
+}
+var Avar = afunc(42)
+
+func A(x int) int {
+ if x == 0 {
+ return 22
+ } else if x == 1 {
+ return 33
+ }
+ return 44
+}
diff --git a/src/cmd/cover/testdata/pkgcfg/a/a2.go b/src/cmd/cover/testdata/pkgcfg/a/a2.go
new file mode 100644
index 0000000..e6b2fc1
--- /dev/null
+++ b/src/cmd/cover/testdata/pkgcfg/a/a2.go
@@ -0,0 +1,8 @@
+package a
+
+func A2() {
+ {
+ }
+ {
+ }
+}
diff --git a/src/cmd/cover/testdata/pkgcfg/a/a_test.go b/src/cmd/cover/testdata/pkgcfg/a/a_test.go
new file mode 100644
index 0000000..a1608e0
--- /dev/null
+++ b/src/cmd/cover/testdata/pkgcfg/a/a_test.go
@@ -0,0 +1,14 @@
+package a_test
+
+import (
+ "cfg/a"
+ "testing"
+)
+
+func TestA(t *testing.T) {
+ a.A(0)
+ var aat a.Atyp
+ at := &aat
+ at.Set(42)
+ println(at.Get())
+}