diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 09:50:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 09:50:02 (GMT) |
commit | bd48d27944453ad83d3ce37b2c867fa0d59a1c15 (patch) | |
tree | f5585b5ce3995541ed6cce7bb4daef97f936be89 /Lib/test/test_fnmatch.py | |
parent | 352601ca00376aaf07d4399096f985d3d8ecb96f (diff) | |
download | cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.zip cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.tar.gz cpython-bd48d27944453ad83d3ce37b2c867fa0d59a1c15.tar.bz2 |
Issue #22493: Inline flags now should be used only at the start of the
regular expression. Deprecation warning is emitted if uses them in the
middle of the regular expression.
Diffstat (limited to 'Lib/test/test_fnmatch.py')
-rw-r--r-- | Lib/test/test_fnmatch.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py index a5f5832..fb74246 100644 --- a/Lib/test/test_fnmatch.py +++ b/Lib/test/test_fnmatch.py @@ -62,14 +62,14 @@ class FnmatchTestCase(unittest.TestCase): class TranslateTestCase(unittest.TestCase): def test_translate(self): - self.assertEqual(translate('*'), r'.*\Z(?ms)') - self.assertEqual(translate('?'), r'.\Z(?ms)') - self.assertEqual(translate('a?b*'), r'a.b.*\Z(?ms)') - self.assertEqual(translate('[abc]'), r'[abc]\Z(?ms)') - self.assertEqual(translate('[]]'), r'[]]\Z(?ms)') - self.assertEqual(translate('[!x]'), r'[^x]\Z(?ms)') - self.assertEqual(translate('[^x]'), r'[\^x]\Z(?ms)') - self.assertEqual(translate('[x'), r'\[x\Z(?ms)') + self.assertEqual(translate('*'), r'(?s:.*)\Z') + self.assertEqual(translate('?'), r'(?s:.)\Z') + self.assertEqual(translate('a?b*'), r'(?s:a.b.*)\Z') + self.assertEqual(translate('[abc]'), r'(?s:[abc])\Z') + self.assertEqual(translate('[]]'), r'(?s:[]])\Z') + self.assertEqual(translate('[!x]'), r'(?s:[^x])\Z') + self.assertEqual(translate('[^x]'), r'(?s:[\^x])\Z') + self.assertEqual(translate('[x'), r'(?s:\[x)\Z') class FilterTestCase(unittest.TestCase): |