Kaydet (Commit) cc50ba26 authored tarafından Ezio Melotti's avatar Ezio Melotti

#14179: merge with 3.2.

...@@ -825,6 +825,16 @@ class ReTests(unittest.TestCase): ...@@ -825,6 +825,16 @@ class ReTests(unittest.TestCase):
self.assertIsNotNone(re.search("123.*-", '123\U0010ffff-')) self.assertIsNotNone(re.search("123.*-", '123\U0010ffff-'))
self.assertIsNotNone(re.search("123.*-", '123\xe9\u20ac\U0010ffff-')) self.assertIsNotNone(re.search("123.*-", '123\xe9\u20ac\U0010ffff-'))
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:
......
...@@ -687,6 +687,7 @@ Andrii V. Mishkovskyi ...@@ -687,6 +687,7 @@ Andrii V. Mishkovskyi
Dom Mitchell Dom Mitchell
Dustin J. Mitchell Dustin J. Mitchell
Zubin Mithra Zubin Mithra
Florian Mladitsch
Doug Moen Doug Moen
The Dragon De Monsyne The Dragon De Monsyne
Skip Montanaro Skip Montanaro
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment