【rich function】VersionCompare replace

This commit is contained in:
sunwei
2020-08-09 22:20:47 +08:00
committed by Kevin Wan
parent e18ca9aac1
commit 4c9b481bdf
2 changed files with 7 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ func TestCustomCompareVersions(t *testing.T) {
}{
{"1", "1.0.1", ">", false},
{"1", "0.9.9", ">", true},
{"1", "1-0.1", "<", true},
{"1", "1.0-1", "<", true},
{"1.0.1", "1-0.1", "<", false},
{"1.0.1", "1.0.1", "==", true},
{"1.0.1", "1.0.2", "==", false},
@@ -30,7 +30,7 @@ func TestCustomCompareVersions(t *testing.T) {
for _, each := range cases {
t.Run(each.ver1, func(t *testing.T) {
actual := CompareVersions(each.ver1, each.ver2, each.operator)
actual := CompareVersions(each.ver1, each.operator, each.ver2)
assert.Equal(t, each.out, actual)
})
}