@@ -35,28 +35,30 @@ function test_proximate_to(tc, pp)
3535{" Hello" , " Hello/" , " ." }, ...
3636{" a/./b" , " a/b" , " ." }, ...
3737{" a/b" , " a/./b" , " ." }, ...
38- {" ./this/one" , " ./this/two" , " ../two" }, ...
39- {" /path/same" , " /path/same/hi/.." , " hi/.." }, ...
40- {" " , " /" , " " }, ...
41- {" /" , " " , " " }, ...
38+ {" ./a/b" , " ./a/c" , " ../c" }, ...
4239{" /" , " /" , " ." }, ...
43- {" /dev/null" , " /dev/null" , " ." }, ...
44- {" /a/b" , " c" , " " }, ...
45- {" c" , " /a/b" , " " }, ...
46- {" /a/b" , " /a/b" , " ." }, ...
47- {" /a/b" , " /a" , " .." }, ...
48- {" /a/b/c/d" , " /a/b" , " ../.." }, ...
49- {" this/one" , " this/two" , " ../two" }};
40+ {" a/b/c/d" , " a/b" , " ../.." }, ...
41+ {" a/b" , " a/c" , " ../c" }};
5042% NOTE: ".." in relative_to(base) is ambiguous including for python.pathlib, C++ <filesystem>, etc.
5143
5244if ispc
5345p = [p , ...
54- {{" c:\a\ b" , " c :/" , " ../.." }, ...
55- {" c:\ " , " c :/a/b" , " a/b" }, ...
46+ {{" C:/a/ b" , " C :/" , " ../.." }, ...
47+ {" C:/ " , " C :/a/b" , " a/b" }, ...
5648{" c:/a/b" , " c:/a/b" , " ." }, ...
5749{" c:/a/b" , " c:/a" , " .." }, ...
5850{" c:\a/b\c/d" , " c:/a\b" , " ../.." }, ...
5951{" c:/path" , " d:/path" , " " }}];
52+ % note: on Windows the drive letter should be uppercase!
53+ else
54+ p = [p , ...
55+ {{" " , " a" , " " }, ...
56+ {" a" , " " , " " }, ...
57+ {" a/b" , " c" , " " }, ...
58+ {" c" , " a/b" , " " }, ...
59+ {" /dev/null" , " /dev/null" , " ." }, ...
60+ {" a/b" , " a/b" , " ." }, ...
61+ {" a/b" , " a" , " .." }}];
6062end
6163
6264end
@@ -66,18 +68,9 @@ function test_proximate_to(tc, pp)
6668
6769p = init_rel();
6870
69- p{8 }{3 } = " /" ;
70- p{12 }{3 } = " c" ;
71- p{13 }{3 } = " /a/b" ;
7271
7372if ispc
74- p{8 }{3 } = " /" ;
75- p{12 }{3 } = " c" ;
76- p{13 }{3 } = " /a/b" ;
77-
7873p{end }{3 } = " d:/path" ;
7974end
8075
81- p{end + 1 } = {" file:///" , " file:///" , " " };
82-
8376end
0 commit comments