diff --git a/cmd/gorepomod/internal/semver/semver_test.go b/cmd/gorepomod/internal/semver/semver_test.go index 21759d25f9a..960071d4212 100644 --- a/cmd/gorepomod/internal/semver/semver_test.go +++ b/cmd/gorepomod/internal/semver/semver_test.go @@ -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)