Add match function for simple tag globbing
All checks were successful
Build / audit (push) Successful in 14m54s
Build / test (push) Successful in 14m46s

This commit is contained in:
2024-03-21 17:52:37 +01:00
parent bc3ba48d85
commit 7e59a8460d
2 changed files with 80 additions and 1 deletions

View File

@ -22,3 +22,19 @@ spec = do
actual = stableTagTransform given
expected = Just "2.6.0"
in actual `shouldBe` expected
describe "match" $ do
it "matches an exact tag prefixed with v" $
let expected = Just "2.6.0"
actual = match "(v)2.6.0" "v2.6.0"
in actual `shouldBe` expected
it "matches a glob pattern prefixed with v" $
let expected = Just "2.6.0"
actual = match "(v)*" "v2.6.0"
in actual `shouldBe` expected
it "ignores suffix after wildcard" $
let expected = Just "2.6.0"
actual = match "(v)*(-rc1)" "v2.6.0-rc1"
in actual `shouldBe` expected