33properties (TestParameter )
44p_relative_to
55p_proximate_to
6- p_is_subdir
7- p_is_prefix
86end
97
108
5957
6058end
6159
62-
63- function [p_is_subdir , p_is_prefix ] = init_is_subdir()
64-
65- p_is_subdir = {
66- {" a/b" , " a/b" , false }, ...
67- {" a//b/c" , " a/b" , true }, ...
68- {" a/b" , " a//b" , false }, ...
69- {" a/./b/c" , " a/b" , false }, ...
70- {" a/b/c" , " a/./b" , false }, ...
71- {" a/b" , " a/b/" , false }, ...
72- {" a/b" , " a" , true }, ...
73- {" a/.c" , " a" , true }
74- };
75- % NOTE: ".." in is_subdir (either argument) is ambiguous
76-
77- if ispc
78- p_is_subdir{end + 1 } = {" c:\" , " c:/" , false };
79- else
80- p_is_subdir{end + 1 } = {" /" , " /" , false };
81- end
82-
83- p_is_prefix = p_is_subdir ;
84- p_is_prefix{1 }{3 } = true ;
85- p_is_prefix{2 }{3 } = false ;
86- p_is_prefix{3 }{3 } = true ;
87- p_is_prefix{6 }{3 } = true ;
88- p_is_prefix{7 }{3 } = false ;
89- p_is_prefix{8 }{3 } = false ;
90- p_is_prefix{9 }{3 } = true ;
91-
9260end
9361
94- end
9562
9663
9764methods (Test )
9865
99-
10066function test_relative_to(tc , p_relative_to )
10167tc .assumeTrue(stdlib .has_java )
10268tc .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 }+" )" )
@@ -108,15 +74,6 @@ function test_proximate_to(tc, p_proximate_to)
10874tc .verifyEqual(stdlib .proximate_to(p_proximate_to{1 }, p_proximate_to{2 }), p_proximate_to{3 }, " proximate_to(" + p_proximate_to{1 } + " ," + p_proximate_to{2 }+" )" )
10975end
11076
111-
112- function test_is_subdir(tc , p_is_subdir )
113- tc .verifyEqual(stdlib .is_subdir(p_is_subdir{1 }, p_is_subdir{2 }), p_is_subdir{3 }, " subdir(" + p_is_subdir{1 } + " ," + p_is_subdir{2 } + " )" )
114- end
115-
116- function test_is_prefix(tc , p_is_prefix )
117- tc .verifyEqual(stdlib .is_prefix(p_is_prefix{1 }, p_is_prefix{2 }), p_is_prefix{3 }, " prefix(" + p_is_prefix{1 } + " ," + p_is_prefix{2 } + " )" )
118- end
119-
12077end
12178
12279end
0 commit comments