bpo-31202: Preserve case of literal parts in Path.glob() on Windows. (GH-16860)
(cherry picked from commit 10ecbadb799ddf3393d1fc80119a3db14724d381)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 95d0b09..4543e37 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -2291,11 +2291,15 @@
P = self.cls
p = P(BASE)
self.assertEqual(set(p.glob("FILEa")), { P(BASE, "fileA") })
+ self.assertEqual(set(p.glob("F*a")), { P(BASE, "fileA") })
+ self.assertEqual(set(map(str, p.glob("FILEa"))), {f"{p}\\FILEa"})
+ self.assertEqual(set(map(str, p.glob("F*a"))), {f"{p}\\fileA"})
def test_rglob(self):
P = self.cls
p = P(BASE, "dirC")
self.assertEqual(set(p.rglob("FILEd")), { P(BASE, "dirC/dirD/fileD") })
+ self.assertEqual(set(map(str, p.rglob("FILEd"))), {f"{p}\\dirD\\FILEd"})
def test_expanduser(self):
P = self.cls