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,25 +36,25 @@ 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 " ) }, ...
41+ {" a/b/" , fullfile( " a " , " b " ) }, ...
3842 {" a/../c" , " c" }, ...
39- {" a/b/../c" , " a/c " }, ...
43+ {" a/b/../c" , fullfile( " a " , " c " ) }, ...
4044 {" a/b/../../c" , " c" }, ...
4145 {" a/b/../../c/.." , " ." }, ...
4246 {" a/b/../../c/../.." , " .." }, ...
43- {" a////b" , " a/b " }, ...
47+ {" a////b" , fullfile( " a " , " b " ) }, ...
4448 {" .a" , " .a" }, ...
4549 {" ..a" , " ..a" }, ...
4650 {" a." , " a." }, ...
4751 {" a.." , " a.." }, ...
4852 {" ./a/." , " a" }, ...
49- {" ../a" , " ../a " }
53+ {" ../a" , fullfile( " .." , " a " ) }
5054};
5155
5256if ispc
53- p{3 }{2 } = " //a/ b" ;
57+ p{3 }{2 } = " \\a\ b" ;
5458end
5559end
5660
0 commit comments