From 68e26349115c9b8d010ced2952ae807f139fbc32 Mon Sep 17 00:00:00 2001 From: wyike Date: Fri, 11 Mar 2022 16:19:32 +0800 Subject: [PATCH] add more test for complicated semver check (#3425) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 楚岳 --- pkg/addon/addon_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/addon/addon_test.go b/pkg/addon/addon_test.go index 6f0d2ba91..fa2c786b1 100644 --- a/pkg/addon/addon_test.go +++ b/pkg/addon/addon_test.go @@ -722,6 +722,21 @@ func TestCheckSemVer(t *testing.T) { require: "v1.2.2", res: true, }, + { + actual: "1.3.0-beta.1", + require: ">=v1.3.0-alpha.1", + res: true, + }, + { + actual: "1.3.0-alpha.2", + require: ">=v1.3.0-alpha.1", + res: true, + }, + { + actual: "1.2.3", + require: ">=v1.3.0-alpha.1", + res: false, + }, } for _, testCase := range testCases { result, err := checkSemVer(testCase.actual, testCase.require)