more test cases
This commit is contained in:
parent
749af4bbe8
commit
80158cece8
|
@ -51,6 +51,24 @@ func TestParse(t *testing.T) {
|
|||
{versionStr: "12345", valid: true, expectedStr: "12345.0.0", expectedCode: 1234500000},
|
||||
{versionStr: "42948", valid: true, expectedStr: "42948.0.0", expectedCode: 4294800000},
|
||||
{versionStr: "42949", valid: false},
|
||||
|
||||
{versionStr: "1 ", valid: false},
|
||||
{versionStr: " 1", valid: false},
|
||||
{versionStr: "a1", valid: false},
|
||||
{versionStr: "1a", valid: false},
|
||||
|
||||
{versionStr: "1.1 ", valid: false},
|
||||
{versionStr: "1. 1", valid: false},
|
||||
{versionStr: "1.1a", valid: false},
|
||||
{versionStr: "1.a1", valid: false},
|
||||
|
||||
{versionStr: "1.1.1 ", valid: false},
|
||||
{versionStr: "1.1. 1", valid: false},
|
||||
{versionStr: "1.1.1a", valid: false},
|
||||
{versionStr: "1.1.a1", valid: false},
|
||||
{versionStr: "1,1.1", valid: false},
|
||||
{versionStr: "1!1.1", valid: false},
|
||||
{versionStr: "1 1.1", valid: false},
|
||||
}
|
||||
|
||||
for i, c := range cases {
|
||||
|
|
Loading…
Reference in New Issue