Skip to content

Commit 7220b3d

Browse files
committed
UnitTestSuite: fix pattern match assertions always succeeding due to a typo
1 parent 45f237e commit 7220b3d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

modules/DependencyControl/UnitTestSuite.moon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class UnitTest
566566
}
567567

568568
match = useRegex and re.match(str, pattern, ...) or str\match pattern, ...
569-
@assert msgs.assert.matches, str, useRegex and "regex" or "Lua", pattern
569+
@assert match, @@msgs.assert.matches, str, useRegex and "regex" or "Lua", pattern
570570

571571
--- Fails the assertion if a string doesn't contain a specified substring.
572572
-- Search is case-sensitive by default.
@@ -615,7 +615,7 @@ class UnitTest
615615
msg = @assertError func, unpack params
616616

617617
match = useRegex and re.match(msg, pattern, ...) or msg\match pattern, ...
618-
@assert msgs.assert.errorMsgMatches, msg, useRegex and "regex" or "Lua", pattern
618+
@assert match, @@msgs.assert.errorMsgMatches, msg, useRegex and "regex" or "Lua", pattern
619619

620620

621621
--- A special case of the UnitTest class for a setup routine

0 commit comments

Comments
 (0)