Skip to content

Commit d139e81

Browse files
committed
test:pure: parameterize normal
1 parent 3000e54 commit d139e81

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/TestFilePure.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
dir_is_subdir
1717
sub_is_subdir
1818
ref_is_subdir
19+
1920
in_parent = {"", ".", "..", "../..", "a/b", "a/b/", "ab/.parent", "ab/.parent.txt", "a/b/../.parent.txt"}
2021
ref_parent = {".", ".", ".", "..", "a", "a", "ab", "ab", "a/b/.."}
22+
2123
in_suffix = {"", "/foo/bar/baz", "/foo/bar/baz/", "foo/bar/baz.txt", "foo/bar/baz.txt.gz", ".stat", ".stat.txt"}
2224
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"}
2330
end
2431

2532
properties
@@ -177,13 +184,10 @@ function test_is_absolute(tc, in_is_absolute, ref_is_absolute)
177184
end
178185

179186

180-
function test_normalize(tc)
181-
tc.assumeTrue(stdlib.has_java)
187+
function test_normalize(tc, in_norm, ref_norm)
182188

183-
tc.verifyEqual(stdlib.normalize(""), ".")
189+
tc.verifyEqual(stdlib.normalize(in_norm), ref_norm)
184190

185-
pabs = stdlib.normalize('2foo//');
186-
tc.verifyEqual(pabs, "2foo")
187191
end
188192

189193

0 commit comments

Comments
 (0)