@@ -85,33 +85,54 @@ def test_join(self):
8585 tester ('ntpath.join("/a")' , '/a' )
8686 tester ('ntpath.join("\\ a")' , '\\ a' )
8787 tester ('ntpath.join("a:")' , 'a:' )
88- tester ('ntpath.join("a:", "b")' , 'a:b' )
89- tester ('ntpath.join("a:", "/b")' , 'a:/b' )
9088 tester ('ntpath.join("a:", "\\ b")' , 'a:\\ b' )
91- tester ('ntpath.join("a", "/b")' , '/b' )
9289 tester ('ntpath.join("a", "\\ b")' , '\\ b' )
9390 tester ('ntpath.join("a", "b", "c")' , 'a\\ b\\ c' )
9491 tester ('ntpath.join("a\\ ", "b", "c")' , 'a\\ b\\ c' )
9592 tester ('ntpath.join("a", "b\\ ", "c")' , 'a\\ b\\ c' )
9693 tester ('ntpath.join("a", "b", "\\ c")' , '\\ c' )
9794 tester ('ntpath.join("d:\\ ", "\\ pleep")' , 'd:\\ pleep' )
9895 tester ('ntpath.join("d:\\ ", "a", "b")' , 'd:\\ a\\ b' )
99- tester ("ntpath.join('c:', '/a')" , 'c:/a' )
100- tester ("ntpath.join('c:/', '/a')" , 'c:/a' )
101- tester ("ntpath.join('c:/a', '/b')" , '/b' )
102- tester ("ntpath.join('c:', 'd:/')" , 'd:/' )
103- tester ("ntpath.join('c:/', 'd:/')" , 'd:/' )
104- tester ("ntpath.join('c:/', 'd:/a/b')" , 'd:/a/b' )
105-
106- tester ("ntpath.join('')" , '' )
107- tester ("ntpath.join('', '', '', '', '')" , '' )
108- tester ("ntpath.join('a')" , 'a' )
96+
10997 tester ("ntpath.join('', 'a')" , 'a' )
11098 tester ("ntpath.join('', '', '', '', 'a')" , 'a' )
11199 tester ("ntpath.join('a', '')" , 'a\\ ' )
112100 tester ("ntpath.join('a', '', '', '', '')" , 'a\\ ' )
113101 tester ("ntpath.join('a\\ ', '')" , 'a\\ ' )
114102 tester ("ntpath.join('a\\ ', '', '', '', '')" , 'a\\ ' )
103+ tester ("ntpath.join('a/', '')" , 'a/' )
104+
105+ tester ("ntpath.join('a/b', 'x/y')" , 'a/b\\ x/y' )
106+ tester ("ntpath.join('/a/b', 'x/y')" , '/a/b\\ x/y' )
107+ tester ("ntpath.join('/a/b/', 'x/y')" , '/a/b/x/y' )
108+ tester ("ntpath.join('c:', 'x/y')" , 'c:x/y' )
109+ tester ("ntpath.join('c:a/b', 'x/y')" , 'c:a/b\\ x/y' )
110+ tester ("ntpath.join('c:a/b/', 'x/y')" , 'c:a/b/x/y' )
111+ tester ("ntpath.join('c:/', 'x/y')" , 'c:/x/y' )
112+ tester ("ntpath.join('c:/a/b', 'x/y')" , 'c:/a/b\\ x/y' )
113+ tester ("ntpath.join('c:/a/b/', 'x/y')" , 'c:/a/b/x/y' )
114+ #tester("ntpath.join('//computer/share', 'x/y')", '//computer/share\\x/y')
115+ #tester("ntpath.join('//computer/share/', 'x/y')", '//computer/share/x/y')
116+ #tester("ntpath.join('//computer/share/a/b', 'x/y')", '//computer/share/a/b\\x/y')
117+
118+ tester ("ntpath.join('a/b', '/x/y')" , '/x/y' )
119+ tester ("ntpath.join('/a/b', '/x/y')" , '/x/y' )
120+ tester ("ntpath.join('c:', '/x/y')" , 'c:/x/y' )
121+ tester ("ntpath.join('c:a/b', '/x/y')" , 'c:/x/y' )
122+ tester ("ntpath.join('c:/', '/x/y')" , 'c:/x/y' )
123+ tester ("ntpath.join('c:/a/b', '/x/y')" , 'c:/x/y' )
124+ #tester("ntpath.join('//computer/share', '/x/y')", '//computer/share/x/y')
125+ #tester("ntpath.join('//computer/share/', '/x/y')", '//computer/share/x/y')
126+ #tester("ntpath.join('//computer/share/a', '/x/y')", '//computer/share/x/y')
127+
128+ tester ("ntpath.join('c:', 'C:x/y')" , 'C:x/y' )
129+ tester ("ntpath.join('c:a/b', 'C:x/y')" , 'C:a/b\\ x/y' )
130+ tester ("ntpath.join('c:/', 'C:x/y')" , 'C:/x/y' )
131+ tester ("ntpath.join('c:/a/b', 'C:x/y')" , 'C:/a/b\\ x/y' )
132+
133+ for x in ('' , 'a/b' , '/a/b' , 'c:' , 'c:a/b' , 'c:/' , 'c:/a/b' ):
134+ for y in ('d:' , 'd:x/y' , 'd:/' , 'd:/x/y' ):
135+ tester ("ntpath.join(%r, %r)" % (x , y ), y )
115136
116137 def test_normpath (self ):
117138 tester ("ntpath.normpath('A//////././//.//B')" , r'A\B' )
0 commit comments