...

Text file src/cmd/go/testdata/script/reuse_hg_hellononhash.txt

Documentation: cmd/go/testdata/script

     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 vcstest/hello@1234567890123456789012345678901234567890 should fail, still print origin info
    10# (40 hex digits is assumed to be a full hash and is a slightly different code path from @nonexist)
    11! go mod download -x -json vcs-test.golang.org/hg/hello.hg@1234567890123456789012345678901234567890
    12cp stdout hellononhash.json
    13stdout '"Version": "1234567890123456789012345678901234567890"'
    14stdout '"Error":.*unknown revision 1234567890123456789012345678901234567890'
    15stdout '"RepoSum": "r1:blLvkhBriVMV[+]6Il4Ub43wlyWXIe1NpobTelF0peaG0="'
    16! stdout '"(TagPrefix|TagSum|Ref|Hash)"'
    17
    18# reuse go mod download vcstest/hello@1234567890123456789012345678901234567890
    19go clean -modcache
    20! go mod download -reuse=hellononhash.json -x -json vcs-test.golang.org/hg/hello.hg@1234567890123456789012345678901234567890
    21! stderr 'hg( .*)* pull'
    22stdout '"Reuse": true'
    23stdout '"Version": "1234567890123456789012345678901234567890"'
    24stdout '"Error":.*unknown revision 1234567890123456789012345678901234567890'
    25stdout '"RepoSum": "r1:blLvkhBriVMV[+]6Il4Ub43wlyWXIe1NpobTelF0peaG0="'
    26! stdout '"(TagPrefix|TagSum|Ref|Hash)"'
    27! stdout '"(Dir|Info|GoMod|Zip)"'

View as plain text