Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
df723e1e
Commit
df723e1e
authored
Mar 13, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#14179: add tests for re.compile. Patch by Florian Mladitsch.
parent
1d4798cb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
Lib/test/test_re.py
Lib/test/test_re.py
+10
-0
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Lib/test/test_re.py
View file @
df723e1e
...
@@ -818,6 +818,16 @@ class ReTests(unittest.TestCase):
...
@@ -818,6 +818,16 @@ class ReTests(unittest.TestCase):
self.assertRaises(OverflowError, _sre.compile, "
abc
", 0, [long_overflow])
self.assertRaises(OverflowError, _sre.compile, "
abc
", 0, [long_overflow])
self.assertRaises(TypeError, _sre.compile, {}, 0, [])
self.assertRaises(TypeError, _sre.compile, {}, 0, [])
def test_compile(self):
# Test return value when given string and pattern as parameter
pattern = re.compile('random pattern')
self.assertIsInstance(pattern, re._pattern_type)
same_pattern = re.compile(pattern)
self.assertIsInstance(same_pattern, re._pattern_type)
self.assertIs(same_pattern, pattern)
# Test behaviour when not given a string or pattern as parameter
self.assertRaises(TypeError, re.compile, 0)
def run_re_tests():
def run_re_tests():
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
if verbose:
if verbose:
...
...
Misc/ACKS
View file @
df723e1e
...
@@ -629,6 +629,7 @@ Roman Milner
...
@@ -629,6 +629,7 @@ Roman Milner
Andrii V. Mishkovskyi
Andrii V. Mishkovskyi
Dustin J. Mitchell
Dustin J. Mitchell
Dom Mitchell
Dom Mitchell
Florian Mladitsch
Doug Moen
Doug Moen
The Dragon De Monsyne
The Dragon De Monsyne
Skip Montanaro
Skip Montanaro
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment