]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: test more commands in mod_build_info_error
authorBryan C. Mills <bcmills@google.com>
Tue, 29 Sep 2020 14:23:07 +0000 (10:23 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 30 Sep 2020 18:07:33 +0000 (18:07 +0000)
For #26909
For #41688

Change-Id: I22f28d426ce499fce6f0f1295dbde425998042aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/258219
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/testdata/script/mod_build_info_err.txt

index a6853b5c8691c715e3143b986b2cde67f36716c6..4a6ee9e8bb7e9b83c7d350f60d172f9d633f7657 100644 (file)
@@ -1,8 +1,19 @@
 # This test verifies that line numbers are included in module import errors.
 # Verifies golang.org/issue/34393.
 
-go list -e -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
-stdout 'bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧'''
+go list -e -mod=mod -deps -f '{{with .Error}}{{.Pos}}: {{.Err}}{{end}}' ./main
+stdout '^bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧''$'
+
+# TODO(#26909): This should include an import stack.
+# (Today it includes only a file and line.)
+! go build ./main
+stderr '^bad[/\\]bad.go:3:8: malformed import path "🐧.example.com/string": invalid char ''🐧''$'
+
+# TODO(#41688): This should include a file and line, and report the reason for the error..
+# (Today it includes only an import stack, and does not indicate the actual problem.)
+! go get -d ./main
+stderr '^m/main imports\n\tm/bad imports\n\t🐧.example.com/string: import missing$'
+
 
 -- go.mod --
 module m