| Index: test/regexpFilters_matching.js |
| diff --git a/test/regexpFilters_matching.js b/test/regexpFilters_matching.js |
| index 8017945dece3c8853665ef668be1446d22647eaa..dbe310f1becb67915923513e7f9b11457a4f811f 100644 |
| --- a/test/regexpFilters_matching.js |
| +++ b/test/regexpFilters_matching.js |
| @@ -34,17 +34,18 @@ exports.setUp = function(callback) |
| +function testMatchInternal(test, text, location, contentType, docDomain, thirdParty, sitekey, expected) |
| +{ |
| + let filter = Filter.fromText(text); |
| + let result = filter.matches(location, RegExpFilter.typeMap[contentType], docDomain, thirdParty, sitekey); |
| + test.equal(!!result, expected, '"' + text + '".matches(' + location + ", " + contentType + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ", " + (sitekey || "no-sitekey") + ")"); |
| +} |
| + |
| function testMatch(test, text, location, contentType, docDomain, thirdParty, sitekey, expected) |
| { |
| - function testMatch_internal(text, location, contentType, docDomain, thirdParty, sitekey, expected) |
| - { |
| - let filter = Filter.fromText(text); |
| - let result = filter.matches(location, RegExpFilter.typeMap[contentType], docDomain, thirdParty, sitekey); |
| - test.equal(!!result, expected, '"' + text + '".matches(' + location + ", " + contentType + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ", " + (sitekey || "no-sitekey") + ")"); |
| - } |
| - testMatch_internal(text, location, contentType, docDomain, thirdParty, sitekey, expected); |
| + testMatchInternal(test, text, location, contentType, docDomain, thirdParty, sitekey, expected); |
| if (!/^@@/.test(text)) |
| - testMatch_internal("@@" + text, location, contentType, docDomain, thirdParty, sitekey, expected); |
| + testMatchInternal(test, "@@" + text, location, contentType, docDomain, thirdParty, sitekey, expected); |
| } |
| exports.testBasicFilters = function(test) |