...
1[short] skip
2[!exec:hg] skip
3
4env GO111MODULE=on
5env GOPROXY=direct
6env GOSUMDB=off
7env GOMODCACHE=$WORK/modcache
8
9# go mod download of a bunch of these should fail (some are invalid) but write good JSON for later
10! go mod download -json vcs-test.golang.org/hg/hello.hg@latest vcs-test.golang.org/hg/hello.hg/v9@latest vcs-test.golang.org/hg/hello.hg/sub/v9@latest vcs-test.golang.org/hg/tagtests.hg@latest vcs-test.golang.org/hg/tagtests.hg@v0.2.2 vcs-test.golang.org/hg/tagtests.hg@default
11cp stdout all.json
12
13# reuse go mod download vcstest/tagtests@default result again with all.json
14go clean -modcache
15go mod download -reuse=all.json -x -json vcs-test.golang.org/hg/tagtests.hg@default
16! stderr 'hg( .*)* pull'
17stdout '"Reuse": true'
18stdout '"Version": "v0.2.3-0.20190509225625-8d0b18b816df"'
19stdout '"Query": "default"'
20stdout '"VCS": "hg"'
21stdout '"URL": ".*/hg/tagtests"'
22! stdout '"TagPrefix"'
23stdout '"RepoSum": "r1:8dnv906Aq1vb9YpNl9pslfva0VfG9enKb6O6NWs0xF0="'
24stdout '"Ref": "default"'
25stdout '"Hash": "8d0b18b816df5e9c564761b405b1d7949c24ee6b"'
26! stdout '"(Dir|Info|GoMod|Zip)"'
27
28# reuse the bulk results with all.json
29go clean -modcache
30! go mod download -reuse=all.json -json vcs-test.golang.org/hg/hello.hg@latest vcs-test.golang.org/hg/hello.hg/v9@latest vcs-test.golang.org/hg/hello.hg/sub/v9@latest vcs-test.golang.org/hg/tagtests.hg@latest vcs-test.golang.org/hg/tagtests.hg@v0.2.2 vcs-test.golang.org/hg/tagtests.hg@default
31! stderr 'hg( .*)* pull'
32stdout '"Reuse": true'
33! stdout '"(Dir|Info|GoMod|Zip)"'View as plain text