|
16 | 16 | dir_is_subdir |
17 | 17 | sub_is_subdir |
18 | 18 | ref_is_subdir |
| 19 | + |
19 | 20 | in_parent = {"", ".", "..", "../..", "a/b", "a/b/", "ab/.parent", "ab/.parent.txt", "a/b/../.parent.txt"} |
20 | 21 | ref_parent = {".", ".", ".", "..", "a", "a", "ab", "ab", "a/b/.."} |
| 22 | + |
21 | 23 | in_suffix = {"", "/foo/bar/baz", "/foo/bar/baz/", "foo/bar/baz.txt", "foo/bar/baz.txt.gz", ".stat", ".stat.txt"} |
22 | 24 | ref_suffix = {"", "", "", ".txt", ".gz", ".stat", ".txt"} |
| 25 | + |
| 26 | +in_norm = {"", "a/b/", "a/../c", "a/b/../c", "a/b/../../c", "a/b/../../c/..", ... |
| 27 | + "a/b/../../c/../..", "a////b"} |
| 28 | +ref_norm = {".", "a/b", "c", "a/c", "c", ".", ... |
| 29 | + "..", "a/b"} |
23 | 30 | end |
24 | 31 |
|
25 | 32 | properties |
@@ -177,13 +184,10 @@ function test_is_absolute(tc, in_is_absolute, ref_is_absolute) |
177 | 184 | end |
178 | 185 |
|
179 | 186 |
|
180 | | -function test_normalize(tc) |
181 | | -tc.assumeTrue(stdlib.has_java) |
| 187 | +function test_normalize(tc, in_norm, ref_norm) |
182 | 188 |
|
183 | | -tc.verifyEqual(stdlib.normalize(""), ".") |
| 189 | +tc.verifyEqual(stdlib.normalize(in_norm), ref_norm) |
184 | 190 |
|
185 | | -pabs = stdlib.normalize('2foo//'); |
186 | | -tc.verifyEqual(pabs, "2foo") |
187 | 191 | end |
188 | 192 |
|
189 | 193 |
|
|
0 commit comments