...
1env GO111MODULE=off
2
3! go test badtest/badexec
4! stdout ^ok
5stdout ^FAIL\tbadtest/badexec
6
7! go test badtest/badsyntax
8! stdout ^ok
9stdout ^FAIL\tbadtest/badsyntax
10
11! go test badtest/badvar
12! stdout ^ok
13stdout ^FAIL\tbadtest/badvar
14
15! go test notest
16! stdout ^ok
17stderr '^notest.hello.go:6:1: syntax error: non-declaration statement outside function body' # Exercise issue #7108
18
19-- badtest/badexec/x_test.go --
20package badexec
21
22func init() {
23 panic("badexec")
24}
25
26-- badtest/badsyntax/x.go --
27package badsyntax
28
29-- badtest/badsyntax/x_test.go --
30package badsyntax
31
32func func func func func!
33
34-- badtest/badvar/x.go --
35package badvar
36
37-- badtest/badvar/x_test.go --
38package badvar_test
39
40func f() {
41 _ = notdefined
42}
43-- notest/hello.go --
44package notest
45
46func hello() {
47 println("hello world")
48}
49Hello world
View as plain text