diff options
author | thirumurugan <67573527+thirumurugan-git@users.noreply.github.com> | 2023-05-18 17:59:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 17:59:31 (GMT) |
commit | dcdc90d384723920e8dea0ee04eae8c219333634 (patch) | |
tree | 86ca2a14764711a0b1586358d2d7236b6643eff0 /Lib/test/test_pathlib.py | |
parent | cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2 (diff) | |
download | cpython-dcdc90d384723920e8dea0ee04eae8c219333634.zip cpython-dcdc90d384723920e8dea0ee04eae8c219333634.tar.gz cpython-dcdc90d384723920e8dea0ee04eae8c219333634.tar.bz2 |
GH-104484: Add case_sensitive argument to `pathlib.PurePath.match()` (GH-104565)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r-- | Lib/test/test_pathlib.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 46a5248..ab2c2b2 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -312,6 +312,11 @@ class _BasePurePathTest(object): # Multi-part glob-style pattern. self.assertFalse(P('/a/b/c.py').match('/**/*.py')) self.assertTrue(P('/a/b/c.py').match('/a/**/*.py')) + # Case-sensitive flag + self.assertFalse(P('A.py').match('a.PY', case_sensitive=True)) + self.assertTrue(P('A.py').match('a.PY', case_sensitive=False)) + self.assertFalse(P('c:/a/B.Py').match('C:/A/*.pY', case_sensitive=True)) + self.assertTrue(P('/a/b/c.py').match('/A/*/*.Py', case_sensitive=False)) def test_ordering_common(self): # Ordering is tuple-alike. @@ -916,7 +921,7 @@ class PureWindowsPathTest(_BasePurePathTest, unittest.TestCase): self.assertEqual(P('//some/share/a/b%#c\xe9').as_uri(), 'file://some/share/a/b%25%23c%C3%A9') - def test_match_common(self): + def test_match(self): P = self.cls # Absolute patterns. self.assertTrue(P('c:/b.py').match('*:/*.py')) |