Issue #5117: Fixed root directory related issue on posixpath.relpath() and
ntpath.relpath().
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 73645f1..e1852c0 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -178,6 +178,16 @@
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):