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 1
1
classdef TestFilePure < matlab .unittest .TestCase
2
2
3
3
properties (TestParameter )
4
- p_root
5
- p_root_name
4
+ p
6
5
end
7
6
8
7
9
8
methods (TestParameterDefinition , Static )
10
9
11
- function [ p_root , p_root_name ] = init_relative_to ()
10
+ function p = init ()
12
11
13
- p_root = {{" " , " " }, ...
14
- {" a/b" , " " }, ...
15
- {" ./a/b" , " " }, ...
16
- {" /etc" , " /" }, ...
17
- {" c:" , " " }, ...
18
- {" c:/etc" , " " }};
19
-
20
- p_root_name = {{" " , " " }, ...
12
+ p = {{" " , " " }, ...
21
13
{" a/b" , " " }, ...
22
14
{" /etc" , " " }, ...
23
15
{" c:/etc" , " " }};
24
16
25
17
if 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:" ;
30
19
end
31
20
32
21
end
@@ -46,8 +35,8 @@ function test_posix(tc)
46
35
end
47
36
end
48
37
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 })
51
40
end
52
41
53
42
end
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