mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
gh-126780: Fix ntpath.normpath()
for drive-relative paths (GH-126801)
This commit is contained in:
parent
0c5556fcb7
commit
60ec854bc2
4 changed files with 34 additions and 25 deletions
|
@ -347,13 +347,18 @@ class TestNtpath(NtpathTestCase):
|
|||
|
||||
tester("ntpath.normpath('..')", r'..')
|
||||
tester("ntpath.normpath('.')", r'.')
|
||||
tester("ntpath.normpath('c:.')", 'c:')
|
||||
tester("ntpath.normpath('')", r'.')
|
||||
tester("ntpath.normpath('/')", '\\')
|
||||
tester("ntpath.normpath('c:/')", 'c:\\')
|
||||
tester("ntpath.normpath('/../.././..')", '\\')
|
||||
tester("ntpath.normpath('c:/../../..')", 'c:\\')
|
||||
tester("ntpath.normpath('/./a/b')", r'\a\b')
|
||||
tester("ntpath.normpath('c:/./a/b')", r'c:\a\b')
|
||||
tester("ntpath.normpath('../.././..')", r'..\..\..')
|
||||
tester("ntpath.normpath('K:../.././..')", r'K:..\..\..')
|
||||
tester("ntpath.normpath('./a/b')", r'a\b')
|
||||
tester("ntpath.normpath('c:./a/b')", r'c:a\b')
|
||||
tester("ntpath.normpath('C:////a/b')", r'C:\a\b')
|
||||
tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue