mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #5117: Fixed root directory related issue on posixpath.relpath() and
ntpath.relpath().
This commit is contained in:
parent
0491047580
commit
50f7d7e213
5 changed files with 26 additions and 4 deletions
|
@ -178,6 +178,16 @@ class TestNtpath(unittest.TestCase):
|
|||
tester('ntpath.relpath("a", "b/c")', '..\\..\\a')
|
||||
tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')
|
||||
tester('ntpath.relpath("a", "a")', '.')
|
||||
tester('ntpath.relpath("/foo/bar/bat", "/x/y/z")', '..\\..\\..\\foo\\bar\\bat')
|
||||
tester('ntpath.relpath("/foo/bar/bat", "/foo/bar")', 'bat')
|
||||
tester('ntpath.relpath("/foo/bar/bat", "/")', 'foo\\bar\\bat')
|
||||
tester('ntpath.relpath("/", "/foo/bar/bat")', '..\\..\\..')
|
||||
tester('ntpath.relpath("/foo/bar/bat", "/x")', '..\\foo\\bar\\bat')
|
||||
tester('ntpath.relpath("/x", "/foo/bar/bat")', '..\\..\\..\\x')
|
||||
tester('ntpath.relpath("/", "/")', '.')
|
||||
tester('ntpath.relpath("/a", "/a")', '.')
|
||||
tester('ntpath.relpath("/a/b", "/a/b")', '.')
|
||||
tester('ntpath.relpath("c:/foo", "C:/FOO")', '.')
|
||||
|
||||
|
||||
class NtCommonTest(test_genericpath.CommonTest):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue