Issue #19912: Fixed numerous bugs in ntpath.splitunc().
* splitunc() no more returns illegal result for paths with redundant slashes.
* splitunc() now correctly processes the u'İ' character
(U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE).
* Added new tests for splitunc().
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index e1852c0..749afbc 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -33,10 +33,24 @@
('c:', '/foo/bar'))
def test_splitunc(self):
+ tester('ntpath.splitunc("c:\\foo\\bar")',
+ ('', 'c:\\foo\\bar'))
+ tester('ntpath.splitunc("c:/foo/bar")',
+ ('', 'c:/foo/bar'))
tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")',
('\\\\conky\\mountpoint', '\\foo\\bar'))
tester('ntpath.splitunc("//conky/mountpoint/foo/bar")',
('//conky/mountpoint', '/foo/bar'))
+ tester('ntpath.splitunc("\\\\\\conky\\mountpoint\\foo\\bar")',
+ ('', '\\\\\\conky\\mountpoint\\foo\\bar'))
+ tester('ntpath.splitunc("///conky/mountpoint/foo/bar")',
+ ('', '///conky/mountpoint/foo/bar'))
+ tester('ntpath.splitunc("\\\\conky\\\\mountpoint\\foo\\bar")',
+ ('', '\\\\conky\\\\mountpoint\\foo\\bar'))
+ tester('ntpath.splitunc("//conky//mountpoint/foo/bar")',
+ ('', '//conky//mountpoint/foo/bar'))
+ self.assertEqual(ntpath.splitunc(u'//conky/MOUNTPO\u0130NT/foo/bar'),
+ (u'//conky/MOUNTPO\u0130NT', u'/foo/bar'))
def test_split(self):
tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar'))