summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-11-05 21:25:02 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-11-05 21:25:02 (GMT)
commit6a3e5f14a6038cc524c325dc33e2cb37510e6e4c (patch)
treeeb259749567ae008eec410e5233aa25fb1c2db5d /Lib/test/test_ntpath.py
parent2a9e3852eeaa3a4d039e2dcedded011dddb612c0 (diff)
downloadcpython-6a3e5f14a6038cc524c325dc33e2cb37510e6e4c.zip
cpython-6a3e5f14a6038cc524c325dc33e2cb37510e6e4c.tar.gz
cpython-6a3e5f14a6038cc524c325dc33e2cb37510e6e4c.tar.bz2
SF bug 478425: Change in os.path.join (ntpath.py)
ntpath.join('a', '') was producing 'a' instead of 'a\\' as in 2.1. Impossible to guess what was ever *intended*, but since split('a\\') produces ('a', ''), I think it's best if join('a', '') gives 'a\\' back.
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 049bbc1..98569f9 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -74,6 +74,14 @@ tester("ntpath.join('c:', 'd:/')", 'd:/')
tester("ntpath.join('c:/', 'd:/')", 'd:/')
tester("ntpath.join('c:/', 'd:/a/b')", 'd:/a/b')
+tester("ntpath.join('')", '')
+tester("ntpath.join('', '', '', '', '')", '')
+tester("ntpath.join('a')", 'a')
+tester("ntpath.join('', 'a')", 'a')
+tester("ntpath.join('', '', '', '', 'a')", 'a')
+tester("ntpath.join('a', '')", 'a\\')
+tester("ntpath.join('a', '', '', '', '')", 'a\\')
+
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')