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