1717 {" a/b/c.txt.gz" , " c.txt.gz" }
1818};
1919
20- p_parent
21-
2220p_stem = {{" /a/b/c" , " c" }, {" /a/b/c/" , " " }, {" a/b/c/" , " " }, {" a/b/c.txt" , " c" }, {" a/b/c.txt.gz" , " c.txt" }}
2321
2422p_join = {{" " , " " , " " }, ...
7068
7169methods (TestParameterDefinition , Static )
7270
73- function [p_root , p_root_name , p_parent ] = init_relative_to(classToTest ) % #ok<INUSD>
71+ function [p_root , p_root_name ] = init_relative_to(classToTest ) % #ok<INUSD>
7472
7573p_root = {{" " , " " }, ...
7674{" a/b" , " " }, ...
8482{" /etc" , " " }, ...
8583{" c:/etc" , " " }};
8684
87- p_parent = {
88- {" " , " ." }, ...
89- {" ." , " ." }, ...
90- {" .." , " ." }, ...
91- {" ../.." , " .." }, ...
92- {" a/" , " ." }, ...
93- {" a/b" , " a" }, ...
94- {" a/b/" , " a" }, ...
95- {" ab/.parent" , " ab" }, ...
96- {" ab/.parent.txt" , " ab" }, ...
97- {" a/b/../.parent.txt" , " a/b/.." }, ...
98- {" a/////b////c" , " a/b" }, ...
99- {" c:/" , " ." }, ...
100- {" c:\" , " ." }, ...
101- {" c:/a/b" , " c:/a" }, ...
102- {" c:\a/b" , " c:\a" }
103- };
104-
10585if ispc
106- p_parent{12 }{2 } = " c:/" ;
107- p_parent{13 }{2 } = " c:/" ;
108- p_parent{14 }{2 } = " c:/a" ;
109- p_parent{15 }{2 } = " c:/a" ;
110- p_parent{end + 1 } = {" c:/a" , " c:/" };
111- p_parent{end + 1 } = {" c:" , " c:/" };
112-
11386p_root{5 }{2 } = " c:" ;
11487p_root{6 }{2 } = " c:/" ;
11588
11689p_root_name{4 }{2 } = " c:" ;
117-
11890end
11991
12092end
@@ -143,10 +115,8 @@ function classSetup(tc, classToTest)
143115end
144116
145117function setup_path(tc )
146- import matlab .unittest .fixtures .PathFixture
147- cwd = fileparts(mfilename(" fullpath" ));
148- top = fullfile(cwd , " .." );
149- tc .applyFixture(PathFixture(top ))
118+ top = fullfile(fileparts(mfilename(" fullpath" )), " .." );
119+ tc .applyFixture(matlab .unittest .fixtures .PathFixture(top ))
150120end
151121
152122end
@@ -170,16 +140,10 @@ function test_join(tc, p_join)
170140tc .verifyEqual(stdlib .join(p_join{1 }, p_join{2 }), p_join{3 })
171141end
172142
173-
174143function test_filename(tc , p_filename )
175144tc .verifyEqual(stdlib .filename(p_filename{1 }), string(p_filename{2 }))
176145end
177146
178-
179- function test_parent(tc , p_parent )
180- tc .verifyEqual(stdlib .parent(p_parent{1 }), p_parent{2 }, p_parent{1 })
181- end
182-
183147function test_suffix(tc , p_suffix )
184148tc .verifyEqual(stdlib .suffix(p_suffix{1 }), string(p_suffix{2 }))
185149end
0 commit comments