[short] skip
[!exec:hg] skip

env GO111MODULE=on
env GOPROXY=direct
env GOSUMDB=off
env GOMODCACHE=$WORK/modcache

# go mod download vcstest/tagtests@default needs a RepoSum again
go mod download -x -json vcs-test.golang.org/hg/tagtests.hg@default
cp stdout tagtestsdefault.json
stdout '"Version": "v0.2.3-0.20190509225625-8d0b18b816df"'
stdout '"Query": "default"'
stdout '"VCS": "hg"'
stdout '"URL": ".*/hg/tagtests"'
! stdout '"TagPrefix"'
! stdout '"TagSum"'
stdout '"RepoSum": "r1:8dnv906Aq1vb9YpNl9pslfva0VfG9enKb6O6NWs0xF0="'
stdout '"Hash": "8d0b18b816df5e9c564761b405b1d7949c24ee6b"'

# reuse go mod download vcstest/tagtests@default result
go clean -modcache
go mod download -reuse=tagtestsdefault.json -x -json vcs-test.golang.org/hg/tagtests.hg@default
! stderr 'hg( .*)* pull'
stdout '"Reuse": true'
stdout '"Version": "v0.2.3-0.20190509225625-8d0b18b816df"'
stdout '"Query": "default"'
stdout '"VCS": "hg"'
stdout '"URL": ".*/hg/tagtests"'
! stdout '"TagPrefix"'
stdout '"RepoSum": "r1:8dnv906Aq1vb9YpNl9pslfva0VfG9enKb6O6NWs0xF0="'
stdout '"Ref": "default"'
stdout '"Hash": "8d0b18b816df5e9c564761b405b1d7949c24ee6b"'
! stdout '"(Dir|Info|GoMod|Zip)"'