summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/testdata/script/test_main_archive.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/go/testdata/script/test_main_archive.txt')
-rw-r--r--libgo/go/cmd/go/testdata/script/test_main_archive.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/libgo/go/cmd/go/testdata/script/test_main_archive.txt b/libgo/go/cmd/go/testdata/script/test_main_archive.txt
new file mode 100644
index 00000000000..410d923d237
--- /dev/null
+++ b/libgo/go/cmd/go/testdata/script/test_main_archive.txt
@@ -0,0 +1,32 @@
+env GO111MODULE=off
+
+# Test that a main_test of 'package main' imports the package,
+# not the installed binary.
+
+[short] skip
+
+env GOBIN=$WORK/bin
+go test main_test
+go install main_test
+
+go list -f '{{.Stale}}' main_test
+stdout false
+
+go test main_test
+
+-- main_test/m.go --
+package main
+
+func F() {}
+func main() {}
+-- main_test/m_test.go --
+package main_test
+
+import (
+ . "main_test"
+ "testing"
+)
+
+func Test1(t *testing.T) {
+ F()
+}