Skip to content

Commit

Permalink
add semver trailing CRLF removal testing
Browse files Browse the repository at this point in the history
  • Loading branch information
antoooks committed May 30, 2024
1 parent 34cd14c commit 749648b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/gorepomod/internal/semver/semver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func TestParse(t *testing.T) {
v: zero,
errMsg: "\"v1.222\" doesn't have the form v1.2.3",
},
"trailing CRLF": {
raw: "v1.2.3\r\n",
v: SemVer{major: 1, minor: 2, patch: 3},
errMsg: "strconv.Atoi: parsing \"3\\r\\n\": invalid syntax",
},
}
for n, tc := range testCases {
v, err := Parse(tc.raw)
Expand Down

0 comments on commit 749648b

Please sign in to comment.