Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #199 from wagnerand/master

Fixed regex creation in test cases
  • Loading branch information...
commit ac5111f0f7c8929b7a6413a6cc05f544c14f8565 2 parents b346070 + 624e008
@mattbasta authored
Showing with 14 additions and 10 deletions.
  1. +10 −6 tests/compat/test_tb18.py
  2. +4 −4 validator/testcases/regex.py
View
16 tests/compat/test_tb18.py
@@ -9,15 +9,19 @@ class TestTB18Compat(CompatTestCase):
def test_js_patterns(self):
"""Test that these js patterns are flagged in Thunderbird 18."""
- def test_pattern(self, pattern):
- self.setUp()
- self.run_regex_for_compat("var x = %s();" % pattern)
- self.assert_compat_error(type_="notice")
-
- yield test_pattern, self, "queryISupportsArray"
+ self.setUp()
+ self.run_regex_for_compat("var x = %s();" % "queryISupportsArray")
+ self.assert_compat_error(type_="notice")
def test_prplIAccount_noNewlines(self):
for method in self.run_xpcom_for_compat(
"prplIAccount", ["noNewlines"]):
self.assert_silent()
self.assert_compat_error(type_="notice")
+
+ def test_unflagged_patterns(self):
+ """Test that these js patterns are _NOT_ flagged in Thunderbird 18."""
+ self.setUp()
+ self.run_regex_for_compat("var x = %s();" % "IncomingServer")
+ self.assert_silent()
+ self.assert_compat_silent()
View
8 validator/testcases/regex.py
@@ -1189,7 +1189,7 @@ def tests(self):
r"\.capabilityPref": 558659,}
# Add restricting prefix for ( or word boundary to prevent substring matching.
- js_patterns.update(dict(("(\b|\()" + k, v) for k, v in prefix_patterns.items()))
+ js_patterns.update(dict((r"(\b|\()" + k, v) for k, v in prefix_patterns.items()))
for pattern, bug in js_patterns.items():
yield self.get_test_bug(
@@ -1319,7 +1319,7 @@ def tests(self):
r"gServer": 577775}
# Add restricting prefix for ( or word boundary to prevent substring matching.
- js_patterns.update(dict(("(\b|\()" + k, v) for k, v in js_patterns.items()))
+ js_patterns = (dict((r"(\b|\()" + k, v) for k, v in js_patterns.items()))
for pattern, bug in js_patterns.items():
yield self.get_test_bug(
@@ -1372,7 +1372,7 @@ def tests(self):
r"gLastPurpleConvId": 812921}
# Add restricting prefix for ( or word boundary to prevent substring matching.
- js_patterns.update(dict(("(\b|\()" + k, v) for k, v in js_patterns.items()))
+ js_patterns = (dict((r"(\b|\()" + k, v) for k, v in js_patterns.items()))
for pattern, bug in js_patterns.items():
yield self.get_test_bug(
@@ -1429,7 +1429,7 @@ def tests(self):
r"gAttachmentNotifier\.handleMutations": 823009}
# Add restricting prefix for ( or word boundary to prevent substring matching.
- js_patterns.update(dict(("(\b|\()" + k, v) for k, v in js_patterns.items()))
+ js_patterns = (dict((r"(\b|\()" + k, v) for k, v in js_patterns.items()))
for pattern, bug in js_patterns.items():
yield self.get_test_bug(
Please sign in to comment.
Something went wrong with that request. Please try again.