Skip to content

Commit 3b487d9

Browse files
committed
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
1 parent 88a8fca commit 3b487d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Lib/test/test_re.py

+18
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,23 @@ def test_bug_926075(self):
497497
self.assert_(re.compile('bug_926075') is not
498498
re.compile(eval("u'bug_926075'")))
499499

500+
class PreTests(unittest.TestCase):
501+
def test_can_2005_2491(self):
502+
import pre
503+
# min < 0
504+
self.assertRaises(pre.error, pre.compile, 'a{4544564564646450,}')
505+
# min > 65535
506+
self.assertRaises(pre.error, pre.compile,
507+
'a{1231313134536434,}')
508+
# max < 0
509+
self.assertRaises(pre.error, pre.compile,
510+
'a{12,4544564564646450}')
511+
# max > 65535
512+
self.assertRaises(pre.error, pre.compile,
513+
'a{12,1231313134536434}')
514+
self.assertRaises(pre.error, pre.compile,
515+
'a{32,14}')
516+
500517
def run_re_tests():
501518
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
502519
if verbose:
@@ -623,6 +640,7 @@ def run_re_tests():
623640

624641
def test_main():
625642
run_unittest(ReTests)
643+
#run_unittest(PreTests)
626644
run_re_tests()
627645

628646
if __name__ == "__main__":

0 commit comments

Comments
 (0)