aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_retract_rationale.txt
blob: 584c3a3849628757a062846c6fc0b84bd10a1ef3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# When there is no rationale, 'go get' should print a hard-coded message.
go get -d example.com/retract/rationale@v1.0.0-empty
stderr '^go: warning: example.com/retract/rationale@v1.0.0-empty is retracted: retracted by module author$'

# 'go list' should print the same hard-coded message.
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale
stdout '^\[retracted by module author\]$'


# When there is a multi-line message, 'go get' should print the first line.
go get -d example.com/retract/rationale@v1.0.0-multiline1
stderr '^go: warning: example.com/retract/rationale@v1.0.0-multiline1 is retracted: short description$'
! stderr 'detail'

# 'go list' should show the full message.
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale
cmp stdout multiline

# 'go get' output should be the same whether the retraction appears at top-level
# or in a block.
go get -d example.com/retract/rationale@v1.0.0-multiline2
stderr '^go: warning: example.com/retract/rationale@v1.0.0-multiline2 is retracted: short description$'
! stderr 'detail'

# Same for 'go list'.
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale
cmp stdout multiline


# 'go get' should omit long messages.
go get -d example.com/retract/rationale@v1.0.0-long
stderr '^go: warning: example.com/retract/rationale@v1.0.0-long is retracted: \(rationale omitted: too long\)'

# 'go list' should show the full message.
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale
stdout '^\[lo{500}ng\]$'


# 'go get' should omit messages with unprintable characters.
go get -d example.com/retract/rationale@v1.0.0-unprintable
stderr '^go: warning: example.com/retract/rationale@v1.0.0-unprintable is retracted: \(rationale omitted: contains non-printable characters\)'

# 'go list' should show the full message.
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale
stdout '^\[Ends with a BEL character. Beep!\x07\]$'


# When there is a comment on a block, but not on individual retractions within
# the block, the rationale should come from the block comment.
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale@v1.0.0-block
stdout '^\[block comment\]$'
go list -m -retracted -f '{{.Retracted}}' example.com/retract/rationale@v1.0.0-blockwithcomment
stdout '^\[inner comment\]$'


# When a version is covered by multiple retractions, all retractions should
# be reported in the order they appear in the file.
go list -m -retracted -f '{{range .Retracted}}{{.}},{{end}}' example.com/retract/rationale@v1.0.0-order
stdout '^degenerate range,single version,$'
go list -m -retracted -f '{{range .Retracted}}{{.}},{{end}}' example.com/retract/rationale@v1.0.1-order
stdout '^single version,degenerate range,$'

# 'go get' will only report the first retraction to avoid being too verbose.
go get -d example.com/retract/rationale@v1.0.0-order
stderr '^go: warning: example.com/retract/rationale@v1.0.0-order is retracted: degenerate range$'
go get -d example.com/retract/rationale@v1.0.1-order
stderr '^go: warning: example.com/retract/rationale@v1.0.1-order is retracted: single version$'

-- go.mod --
module m

go 1.14

-- multiline --
[short description
more

detail
suffix]