From: Andrew M. Kuchling Date: Wed, 31 Aug 2005 12:56:50 +0000 (+0000) Subject: For reference, add tests for PCRE fix; the tests aren't run by default because I... X-Git-Tag: v2.3.6c1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b487d9cf91454253ced3f1b224d09301aef5e85;p=thirdparty%2FPython%2Fcpython.git 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 --- diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index fb8b175df8ed..bc17d8d30c58 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -497,6 +497,23 @@ class ReTests(unittest.TestCase): 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: @@ -623,6 +640,7 @@ def run_re_tests(): def test_main(): run_unittest(ReTests) + #run_unittest(PreTests) run_re_tests() if __name__ == "__main__":