Implement almost full semver comparison (fixes #436)

This commit is contained in:
Jakob Borg
2014-07-30 08:57:27 +02:00
parent 115b967e5b
commit 4afe02cb21
2 changed files with 111 additions and 7 deletions

View File

@@ -20,6 +20,14 @@ var testcases = []struct {
{"0.1.10", "0.1.9", 1},
{"0.10.0", "0.2.0", 1},
{"30.10.0", "4.9.0", 1},
{"0.9.0-beta7", "0.9.0-beta6", 1},
{"1.0.0-alpha", "1.0.0-alpha.1", -1},
{"1.0.0-alpha.1", "1.0.0-alpha.beta", -1},
{"1.0.0-alpha.beta", "1.0.0-beta", -1},
{"1.0.0-beta", "1.0.0-beta.2", -1},
{"1.0.0-beta.2", "1.0.0-beta.11", -1},
{"1.0.0-beta.11", "1.0.0-rc.1", -1},
{"1.0.0-rc.1", "1.0.0", -1},
}
func TestCompareVersions(t *testing.T) {