@@ -32,27 +32,39 @@ function test_proximate_to(tc, pp)
3232{" Hello" , " Hello/" , " ." }, ...
3333{" a/./b" , " a/b" , " ." }, ...
3434{" a/b" , " a/./b" , " ." }, ...
35- {" ./a/b" , " ./a/c" , fullfile(" .." , " c" )}, ...
3635{" /" , " /" , " ." }, ...
36+ {" a/b" , " a/b" , " ." } ...
37+ };
38+ % NOTE: ".." in relative_to(base) is ambiguous including for python.pathlib, C++ <filesystem>, etc.
39+
40+ if stdlib .has_dotnet() || stdlib .python_version() >= " 3.12"
41+ p = [p , {
42+ {" /a/b" , " /a/c" , fullfile(" .." , " c" )}, ...
3743{" a/b/c/d" , " a/b" , fullfile(" .." , " .." )}, ...
3844{" a/b" , " a/c" , fullfile(" .." , " c" )}, ...
3945{" a/b" , " c" , fullfile(" .." , " .." , " c" )}, ...
4046{" c" , " a/b" , fullfile(" .." , " a" , " b" )}, ...
41- {" a/b" , " a/b" , " ." }, ...
42- {" a/b" , " a" , " .." }
43- };
44- % NOTE: ".." in relative_to(base) is ambiguous including for python.pathlib, C++ <filesystem>, etc.
47+ {" a/b" , " a" , " .." }, ...
48+ }];
49+ end
4550
4651if ispc
47- p = [ p , ...
48- {{ " C:/a/b " , " C:/ " , fullfile( " .. " , " .. " )}, ...
49- { " C:/ " , " C:/a/b " , fullfile( " a " , " b " )}, ...
50- {" c :/a/b" , " c:/a/b " , " . " }, ...
52+
53+ if stdlib .has_dotnet() || stdlib .python_version() >= " 3.12 "
54+ p = [ p , { ...
55+ {" C :/a/b" , " C:/ " , fullfile( " .. " , " .. " ) }, ...
5156{" c:/a/b" , " c:/a" , " .." }, ...
5257{" c:\a/b\c/d" , " c:/a\b" , fullfile(" .." , " .." )}, ...
58+ }];
59+ end
60+
61+ p = [p , {
62+ {" C:/" , " C:/a/b" , fullfile(" a" , " b" )}, ...
63+ {" c:/a/b" , " c:/a/b" , " ." }, ...
5364{" C:/path" , " D:/path" , " " }, ...
5465{" D:/a/b" , " c" , " " }}];
5566% note: on Windows the drive letter should be uppercase!
67+
5668else
5769 p = [p , ...
5870{{" " , " a" , " a" }, ...
0 commit comments