mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-46208: Fix normalization of relative paths in _Py_normpath()/os.path.normpath (GH-30362)
This commit is contained in:
parent
9925e70e48
commit
9c5fa9c97c
4 changed files with 43 additions and 9 deletions
|
@ -329,13 +329,30 @@ class PosixPathTest(unittest.TestCase):
|
|||
("/..", "/"),
|
||||
("/../", "/"),
|
||||
("/..//", "/"),
|
||||
("//.", "//"),
|
||||
("//..", "//"),
|
||||
("//...", "//..."),
|
||||
("//../foo", "//foo"),
|
||||
("//../../foo", "//foo"),
|
||||
("/../foo", "/foo"),
|
||||
("/../../foo", "/foo"),
|
||||
("/../foo/../", "/"),
|
||||
("/../foo/../bar", "/bar"),
|
||||
("/../../foo/../bar/./baz/boom/..", "/bar/baz"),
|
||||
("/../../foo/../bar/./baz/boom/.", "/bar/baz/boom"),
|
||||
("foo/../bar/baz", "bar/baz"),
|
||||
("foo/../../bar/baz", "../bar/baz"),
|
||||
("foo/../../../bar/baz", "../../bar/baz"),
|
||||
("foo///../bar/.././../baz/boom", "../baz/boom"),
|
||||
("foo/bar/../..///../../baz/boom", "../../baz/boom"),
|
||||
("/foo/..", "/"),
|
||||
("/foo/../..", "/"),
|
||||
("//foo/..", "//"),
|
||||
("//foo/../..", "//"),
|
||||
("///foo/..", "/"),
|
||||
("///foo/../..", "/"),
|
||||
("////foo/..", "/"),
|
||||
("/////foo/..", "/"),
|
||||
]
|
||||
|
||||
def test_normpath(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue