Skip to content

Commit

Permalink
cmd/go: test more commands in mod_build_info_error
Browse files Browse the repository at this point in the history
For #26909
For #41688

Change-Id: I22f28d426ce499fce6f0f1295dbde425998042aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/258219
Trust: Bryan C. Mills <[email protected]>
Trust: Jay Conrod <[email protected]>
Run-TryBot: Bryan C. Mills <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Jay Conrod <[email protected]>
Reviewed-by: Michael Matloob <[email protected]>
  • Loading branch information
Bryan C. Mills committed Sep 30, 2020
1 parent bb9b319 commit f811663
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/cmd/go/testdata/script/mod_build_info_err.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f811663

Please sign in to comment.