|
80 | 80 | p_relative_to = {{"", "", "."}, ... |
81 | 81 | {"Hello", "Hello", "."}, ... |
82 | 82 | {"Hello", "Hello/", "."}, ... |
| 83 | +{"a/./b", "a/b", "."}, ... |
| 84 | +{"a/b", "a/./b", "."}, ... |
83 | 85 | {"./this/one", "./this/two", "../two"}, ... |
84 | 86 | {"/path/same", "/path/same/hi/..", "hi/.."}, ... |
85 | 87 | {"", "/", ""}, ... |
|
113 | 115 | p_proximate_to = p_relative_to; |
114 | 116 | % NOTE: ".." in proximate_to(base) is ambiguous including for python.pathlib, C++ <filesystem>, etc |
115 | 117 |
|
116 | | -p_proximate_to{6}{3} = "/"; |
117 | | -p_proximate_to{10}{3} = "c"; |
118 | | -p_proximate_to{11}{3} = "/a/b"; |
| 118 | +p_proximate_to{8}{3} = "/"; |
| 119 | +p_proximate_to{12}{3} = "c"; |
| 120 | +p_proximate_to{13}{3} = "/a/b"; |
119 | 121 |
|
120 | 122 | p_proximate_to{end}{3} = "d:/path"; |
121 | 123 |
|
|
152 | 154 |
|
153 | 155 | p_is_subdir = { |
154 | 156 | {"a/b", "a/b", false}, ... |
| 157 | + {"a//b/c", "a/b", false}, ... |
| 158 | + {"a/b", "a//b", false}, ... |
| 159 | + {"a/./b/c", "a/b", false}, ... |
| 160 | + {"a/b/c", "a/./b", true}, ... |
155 | 161 | {"a/b", "a/b/", false}, ... |
156 | 162 | {"a/b", "a", true}, ... |
157 | 163 | {"a/.c", "a", true} |
@@ -267,7 +273,7 @@ function test_with_suffix(tc) |
267 | 273 |
|
268 | 274 | function test_relative_to(tc, p_relative_to) |
269 | 275 | tc.assumeTrue(stdlib.has_java) |
270 | | -tc.verifyEqual(stdlib.relative_to(p_relative_to{1}, p_relative_to{2}), p_relative_to{3}) |
| 276 | +tc.verifyEqual(stdlib.relative_to(p_relative_to{1}, p_relative_to{2}), p_relative_to{3}, "relative_to(" + p_relative_to{1} + "," + p_relative_to{2}+")") |
271 | 277 | end |
272 | 278 |
|
273 | 279 |
|
|
0 commit comments