Skip to content

GH-45322: Add test for glob slash and backslash consistency #136834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')])
Expand Down
Loading