...
1env GO111MODULE=off
2
3# Test that a main_test of 'package main' imports the package,
4# not the installed binary.
5
6[short] skip
7
8env GOBIN=$WORK/bin
9go test main_test
10go install main_test
11
12go list -f '{{.Stale}}' main_test
13stdout false
14
15go test main_test
16
17-- main_test/m.go --
18package main
19
20func F() {}
21func main() {}
22-- main_test/m_test.go --
23package main_test
24
25import (
26 . "main_test"
27 "testing"
28)
29
30func Test1(t *testing.T) {
31 F()
32}
View as plain text