33properties (TestParameter )
44p = init_norm()
55d = init_drop_slash()
6+ norm_fun = {@stdlib.normalize, @stdlib.native.normalize, @stdlib.java.normalize, @stdlib.python.normalize}
67end
78
89methods (TestClassSetup )
@@ -13,8 +14,11 @@ function pkg_path(tc)
1314end
1415
1516methods (Test , TestTags = " pure" )
16- function test_normalize(tc , p )
17- tc .verifyEqual(stdlib .normalize(p{1 }), p{2 }, ...
17+
18+ function test_normalize(tc , p , norm_fun )
19+ is_capable(tc , norm_fun )
20+
21+ tc .verifyEqual(norm_fun(p{1 }), p{2 }, ...
1822 sprintf(" normalize(%s) mex: %d" , p{1 }, stdlib .is_mex_fun(" stdlib.normalize" )))
1923end
2024
@@ -32,26 +36,26 @@ function test_drop_slash(tc, d)
3236p = {
3337 {" " , " ." }, ...
3438 {" a/.." , " ." }, ...
35- {" //a/b/" , " /a/b" }, ...
36- {" /a/b/" , " /a/b" }, ...
37- {" a/b/" , " a/b" }, ...
39+ {" /a/b/" , fullfile(" /a" , " b" )}, ...
40+ {" a/b/" , fullfile(" a" , " b" )}, ...
3841 {" a/../c" , " c" }, ...
39- {" a/b/../c" , " a/c " }, ...
42+ {" a/b/../c" , fullfile( " a " , " c " ) }, ...
4043 {" a/b/../../c" , " c" }, ...
4144 {" a/b/../../c/.." , " ." }, ...
4245 {" a/b/../../c/../.." , " .." }, ...
43- {" a////b" , " a/b " }, ...
46+ {" a////b" , fullfile( " a " , " b " ) }, ...
4447 {" .a" , " .a" }, ...
4548 {" ..a" , " ..a" }, ...
4649 {" a." , " a." }, ...
4750 {" a.." , " a.." }, ...
4851 {" ./a/." , " a" }, ...
49- {" ../a" , " ../a " }
52+ {" ../a" , fullfile( " .." , " a " ) }
5053};
5154
5255if ispc
53- p{3 }{ 2 } = " //a/b" ;
56+ p{end + 1 } = { " //a/b/ " , " \\a\b " } ;
5457end
58+
5559end
5660
5761
0 commit comments