summaryrefslogtreecommitdiff
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-18 13:55:29 +0000
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-18 13:55:29 +0000
commit50f7d7e21346875886d0b86c50ff46adb7049b6b (patch)
tree2063a0d1532b4b11b60ac36514b9e77b24dc5481 /Lib/test/test_ntpath.py
parent0491047580e18f06727146fcdfc6b46c83ef537e (diff)
downloadcpython-git-50f7d7e21346875886d0b86c50ff46adb7049b6b.tar.gz
Issue #5117: Fixed root directory related issue on posixpath.relpath() and
ntpath.relpath().
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 73645f19bf..e1852c0eb7 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -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):