forked from rogpeppe/gohack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DO NOT MERGE The test fails because go-internal's proxy doesn't support .../@v/list requests. Fixes rogpeppe#62
- Loading branch information
Showing
3 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cd repo | ||
go get golang.org/x/text | ||
env GOHACK=$WORK/gohack | ||
gohack get golang.org/x/text/language | ||
# Check that golang.org/x/text/language resolved | ||
# to golang.org/x/text by examining stdout. | ||
# Trust the other get tests to ensure that everything else went ok. | ||
stdout '^golang.org/x/text => .*/gohack/golang.org/x/text$' | ||
! stderr .+ | ||
|
||
gohack undo | ||
! stderr .+ | ||
|
||
# Check that deduplication works across modules and packages. | ||
gohack get golang.org/x/text golang.org/x/text/language golang.org/x/text/unused | ||
stdout '^golang.org/x/text => .*/gohack/golang.org/x/text$' | ||
! stdout language | ||
! stdout unused | ||
! stderr .+ | ||
|
||
-- repo/main.go -- | ||
package main | ||
import ( | ||
"golang.org/x/text/language" | ||
_ "golang.org/x/text/unused" | ||
) | ||
|
||
var _ = language.Make | ||
|
||
func main() { | ||
} | ||
|
||
-- repo/go.mod -- | ||
module example.com/repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# --help flag produces output to stderr and fails | ||
! gohack get --help | ||
stderr '^usage: get \[-vcs] \[-u] \[-f] \[module...]\nRun ''gohack help get'' for details.\n' | ||
stderr '^usage: get \[-vcs] \[-u] \[-f] \[module/package...]\nRun ''gohack help get'' for details.\n' | ||
! stdout .+ | ||
|
||
gohack help get | ||
stdout '^usage: get \[-vcs] \[-u] \[-f] \[module...]$' | ||
stdout '^usage: get \[-vcs] \[-u] \[-f] \[module/package...]$' | ||
! stderr .+ |