diff --git a/versioning_test.go b/versioning_test.go index 99fa537..c0c44bf 100644 --- a/versioning_test.go +++ b/versioning_test.go @@ -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 {