From 14b698c4364f811d05adea80303bf66d202d564d Mon Sep 17 00:00:00 2001 From: Moqodow Date: Sat, 19 Jul 2025 17:26:02 +0200 Subject: [PATCH] Add test for glob slash and backslash consistency --- Lib/test/test_glob.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index d0ed5129253cdf..2659d1ee39c83d 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -160,6 +160,13 @@ def test_glob_nested_directory(self): self.norm('a', 'bcd', 'efg')]) eq(self.glob('a', 'bcd', '*g'), [self.norm('a', 'bcd', 'efg')]) + def test_glob_consistency(self): + eq = self.assertSequencesEqual_noorder + if sys.platform.startswith("win"): + eq(self.glob(r'a\\\\bcd/efg', '*'), [(rf'{self.tempdir}\a\\\\bcd/efg\ha')]) + else: + eq(self.glob('a////bcd/efg', '*'), [(f'{self.tempdir}/a////bcd/efg/ha')]) + def test_glob_directory_names(self): eq = self.assertSequencesEqual_noorder eq(self.glob('*', 'D'), [self.norm('a', 'D')])