Commits

Andrew Kuchling  committed c353c27

For reference, add tests for PCRE fix; the tests aren't run by default because I wanted to minimize upheaval to the 2.3 test suite

  • Participants
  • Parent commits a185d69
  • Branches 2.3

Comments (0)

Files changed (1)

File Lib/test/test_re.py

         self.assert_(re.compile('bug_926075') is not
                      re.compile(eval("u'bug_926075'")))
 
+class PreTests(unittest.TestCase):
+    def test_can_2005_2491(self):
+        import pre
+        # min < 0
+        self.assertRaises(pre.error, pre.compile, 'a{4544564564646450,}')
+        # min > 65535
+        self.assertRaises(pre.error, pre.compile,
+                          'a{1231313134536434,}')
+        # max < 0
+        self.assertRaises(pre.error, pre.compile,
+                          'a{12,4544564564646450}')
+        # max > 65535
+        self.assertRaises(pre.error, pre.compile,
+                          'a{12,1231313134536434}')
+        self.assertRaises(pre.error, pre.compile,
+                          'a{32,14}')
+    
 def run_re_tests():
     from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
     if verbose:
 
 def test_main():
     run_unittest(ReTests)
+    #run_unittest(PreTests)
     run_re_tests()
 
 if __name__ == "__main__":