|
|
@ -70,8 +70,10 @@ func TestParse(t *testing.T) {
|
|
|
|
// Test invalid characters in epoch
|
|
|
|
// Test invalid characters in epoch
|
|
|
|
{"a:0-0", version{}, true},
|
|
|
|
{"a:0-0", version{}, true},
|
|
|
|
{"A:0-0", version{}, true},
|
|
|
|
{"A:0-0", version{}, true},
|
|
|
|
// Test version not starting with a digit
|
|
|
|
// Test version not starting with a digit.
|
|
|
|
{"0:abc3-0", version{}, true},
|
|
|
|
// While recommended by the specification, this is not strictly required and
|
|
|
|
|
|
|
|
// at least one vulnerable Alpine package deviates from this scheme.
|
|
|
|
|
|
|
|
{"0:abc3-0", version{epoch: 0, version: "abc3", revision: "0"}, false},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _, c := range cases {
|
|
|
|
for _, c := range cases {
|
|
|
|
v, err := newVersion(c.str)
|
|
|
|
v, err := newVersion(c.str)
|
|
|
|