mirror of
https://github.com/goharbor/harbor
synced 2025-04-14 12:43:41 +00:00
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:
parent
2ea53444e6
commit
0fb076a09a
|
@ -73,6 +73,16 @@ func TestMatch(t *testing.T) {
|
||||||
str: "1.01",
|
str: "1.01",
|
||||||
match: false,
|
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 {
|
for _, c := range cases {
|
||||||
match, err := Match(c.pattern, c.str)
|
match, err := Match(c.pattern, c.str)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user