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:23:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:23:18 +0000
commit43a123c1ae6613b3efeed291fa552ecd909d3acf (patch)
treefd92518b7024bc74031f78a1cf9e454b65e73665 /src/cmd/cover/testdata/pkgcfg/a
parentInitial commit. (diff)
downloadgolang-1.20-43a123c1ae6613b3efeed291fa552ecd909d3acf.tar.xz
golang-1.20-43a123c1ae6613b3efeed291fa552ecd909d3acf.zip
Adding upstream version 1.20.14.upstream/1.20.14upstream
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())
+}