add match many version pattern test (#18092)

Signed-off-by: lengrongfu <1275177125@qq.com>

Signed-off-by: lengrongfu <1275177125@qq.com>
This commit is contained in:
rongfu.leng 2023-01-16 16:40:19 +08:00 committed by GitHub
parent 2ea53444e6
commit 0fb076a09a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,16 @@ func TestMatch(t *testing.T) {
str: "1.01",
match: false,
},
{
pattern: "v2.[4-6].*", // match v2.4.*~v2.7.* version
str: "v2.4.0",
match: true,
},
{
pattern: "v2.[4-7].*", // match v2.4.*~v2.7.* version
str: "v2.7.0",
match: true,
},
}
for _, c := range cases {
match, err := Match(c.pattern, c.str)