diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ntpath.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index fe997b3..049bbc1 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -74,6 +74,30 @@ tester("ntpath.join('c:', 'd:/')", 'd:/') tester("ntpath.join('c:/', 'd:/')", 'd:/') tester("ntpath.join('c:/', 'd:/a/b')", 'd:/a/b') +tester("ntpath.normpath('A//////././//.//B')", r'A\B') +tester("ntpath.normpath('A/./B')", r'A\B') +tester("ntpath.normpath('A/foo/../B')", r'A\B') +tester("ntpath.normpath('C:A//B')", r'C:A\B') +tester("ntpath.normpath('D:A/./B')", r'D:A\B') +tester("ntpath.normpath('e:A/foo/../B')", r'e:A\B') + +# Next 3 seem dubious, and especially the 3rd, but normpath is possibly +# trying to leave UNC paths alone without actually knowing anything about +# them. +tester("ntpath.normpath('C:///A//B')", r'C:\\\A\B') +tester("ntpath.normpath('D:///A/./B')", r'D:\\\A\B') +tester("ntpath.normpath('e:///A/foo/../B')", r'e:\\\A\B') + +tester("ntpath.normpath('..')", r'..') +tester("ntpath.normpath('.')", r'.') +tester("ntpath.normpath('')", r'.') +tester("ntpath.normpath('/')", '\\') +tester("ntpath.normpath('c:/')", 'c:\\') +tester("ntpath.normpath('/../.././..')", '\\') +tester("ntpath.normpath('c:/../../..')", 'c:\\') +tester("ntpath.normpath('../.././..')", r'..\..\..') +tester("ntpath.normpath('K:../.././..')", r'K:..\..\..') + if errors: raise TestFailed(str(errors) + " errors.") elif verbose: |