chore: add skipper for secure (#913)

This commit is contained in:
boojack
2023-01-07 10:51:34 +08:00
committed by GitHub
parent 96798e10b4
commit 46c13a4b7f
8 changed files with 74 additions and 6 deletions

View File

@ -0,0 +1,33 @@
package version
import "testing"
func TestIsVersionGreaterOrEqualThan(t *testing.T) {
tests := []struct {
version string
target string
want bool
}{
{
version: "0.9.1",
target: "0.9.1",
want: true,
},
{
version: "0.10.0",
target: "0.9.1",
want: true,
},
{
version: "0.9.0",
target: "0.9.1",
want: false,
},
}
for _, test := range tests {
result := IsVersionGreaterOrEqualThan(test.version, test.target)
if result != test.want {
t.Errorf("got result %v, want %v.", result, test.want)
}
}
}