First iteration on feedback

This commit is contained in:
Simon Engledew 2020-12-01 20:08:41 +00:00
parent 56b1ead679
commit 4d862616ce
No known key found for this signature in database
GPG key ID: 84302E7B02FE8BCE
7 changed files with 50 additions and 41 deletions

View file

@ -269,26 +269,28 @@ test("formatWorkflowCause()", (t) => {
t.deepEqual(actionsutil.formatWorkflowCause([]), undefined);
});
test("patternsOverlap()", (t) => {
t.false(actionsutil.patternsOverlap("main-*", "main"));
t.true(actionsutil.patternsOverlap("*", "*"));
t.true(actionsutil.patternsOverlap("*", "main-*"));
t.false(actionsutil.patternsOverlap("main-*", "*"));
t.false(actionsutil.patternsOverlap("main-*", "main"));
t.true(actionsutil.patternsOverlap("main", "main"));
t.false(actionsutil.patternsOverlap("*", "feature/*"));
t.true(actionsutil.patternsOverlap("**", "feature/*"));
t.false(actionsutil.patternsOverlap("feature-*", "**"));
t.false(actionsutil.patternsOverlap("a/**/c", "a/**/d"));
t.false(actionsutil.patternsOverlap("a/**/c", "a/**"));
test("patternIsSuperset()", (t) => {
t.false(actionsutil.patternIsSuperset("main-*", "main"));
t.true(actionsutil.patternIsSuperset("*", "*"));
t.true(actionsutil.patternIsSuperset("*", "main-*"));
t.false(actionsutil.patternIsSuperset("main-*", "*"));
t.false(actionsutil.patternIsSuperset("main-*", "main"));
t.true(actionsutil.patternIsSuperset("main", "main"));
t.false(actionsutil.patternIsSuperset("*", "feature/*"));
t.true(actionsutil.patternIsSuperset("**", "feature/*"));
t.false(actionsutil.patternIsSuperset("feature-*", "**"));
t.false(actionsutil.patternIsSuperset("a/**/c", "a/**/d"));
t.false(actionsutil.patternIsSuperset("a/**/c", "a/**"));
t.true(actionsutil.patternIsSuperset("a/**/c", "a/main-**/c"));
t.false(actionsutil.patternIsSuperset("a/main-**/c", "a/**/c"));
t.true(
actionsutil.patternsOverlap(
actionsutil.patternIsSuperset(
"/robin/*/release/*",
"/robin/moose/release/goose"
)
);
t.false(
actionsutil.patternsOverlap(
actionsutil.patternIsSuperset(
"/robin/moose/release/goose",
"/robin/*/release/*"
)