File tree Expand file tree Collapse file tree 2 files changed +42
-17
lines changed Expand file tree Collapse file tree 2 files changed +42
-17
lines changed Original file line number Diff line number Diff line change 11classdef TestFilePure < matlab .unittest .TestCase
22
33properties (TestParameter )
4- p_root
5- p_root_name
4+ p
65end
76
87
98methods (TestParameterDefinition , Static )
109
11- function [ p_root , p_root_name ] = init_relative_to ()
10+ function p = init ()
1211
13- p_root = {{" " , " " }, ...
14- {" a/b" , " " }, ...
15- {" ./a/b" , " " }, ...
16- {" /etc" , " /" }, ...
17- {" c:" , " " }, ...
18- {" c:/etc" , " " }};
19-
20- p_root_name = {{" " , " " }, ...
12+ p = {{" " , " " }, ...
2113{" a/b" , " " }, ...
2214{" /etc" , " " }, ...
2315{" c:/etc" , " " }};
2416
2517if ispc
26- p_root{5 }{2 } = " c:" ;
27- p_root{6 }{2 } = " c:/" ;
28-
29- p_root_name{4 }{2 } = " c:" ;
18+ p{4 }{2 } = " c:" ;
3019end
3120
3221end
@@ -46,8 +35,8 @@ function test_posix(tc)
4635end
4736end
4837
49- function test_root (tc , p_root )
50- tc .verifyEqual(stdlib .root(p_root {1 }), p_root {2 })
38+ function test_root_name (tc , p )
39+ tc .verifyEqual(stdlib .root_name(p {1 }), p {2 })
5140end
5241
5342end
Original file line number Diff line number Diff line change 1+ classdef TestRoot < matlab .unittest .TestCase
2+
3+ properties (TestParameter )
4+ use_java = num2cell(unique([stdlib.has_java(), false ]))
5+ p
6+ end
7+
8+
9+ methods (TestParameterDefinition , Static )
10+
11+ function p = init()
12+
13+ p = {{" " , " " }, ...
14+ {" a/b" , " " }, ...
15+ {" ./a/b" , " " }, ...
16+ {" /etc" , " /" }, ...
17+ {" c:" , " " }, ...
18+ {" c:/etc" , " " }};
19+
20+ if ispc
21+ p{5 }{2 } = " c:" ;
22+ p{6 }{2 } = " c:/" ;
23+ end
24+
25+ end
26+
27+ end
28+
29+
30+ methods (Test )
31+ function test_root(tc , p , use_java )
32+ tc .verifyEqual(stdlib .root(p{1 }, use_java ), p{2 })
33+ end
34+ end
35+
36+ end
You can’t perform that action at this time.
0 commit comments