|
27 | 27 | "a/b/../../c/../..", "a////b"} |
28 | 28 | ref_norm = {".", "a/b", "c", "a/c", "c", ".", ... |
29 | 29 | "..", "a/b"} |
| 30 | + |
| 31 | +in_root |
| 32 | +ref_root |
30 | 33 | end |
31 | 34 |
|
32 | 35 | properties |
33 | 36 | tobj |
34 | 37 | end |
35 | 38 |
|
36 | 39 | methods (TestParameterDefinition, Static) |
37 | | -function [base_relative_to, other_relative_to, ref_relative_to, ref_proximate_to] = init_relative_to(classToTest) %#ok<INUSD> |
| 40 | +function [base_relative_to, other_relative_to, ref_relative_to, ref_proximate_to, in_root, ref_root] = init_relative_to(classToTest) %#ok<INUSD> |
| 41 | + |
| 42 | +in_root = {"", "a/b", "./a/b", "../a/b", "/etc", "c:/etc"}; |
| 43 | +ref_root = {"", "", "", "", "/", ""}; |
38 | 44 |
|
39 | 45 | if ispc |
40 | 46 |
|
|
49 | 55 | ref_proximate_to = ref_relative_to; |
50 | 56 | ref_proximate_to{end} = other_relative_to{end}; |
51 | 57 |
|
| 58 | +ref_root{end} = "c:/"; |
| 59 | + |
52 | 60 | else |
53 | 61 |
|
54 | 62 | base_relative_to = {'', '', '/', '/', 'Hello', 'Hello', '/dev/null', '/a/b', 'c', ... |
@@ -191,6 +199,13 @@ function test_normalize(tc, in_norm, ref_norm) |
191 | 199 | end |
192 | 200 |
|
193 | 201 |
|
| 202 | +function test_root(tc, in_root, ref_root) |
| 203 | + |
| 204 | +tc.verifyEqual(stdlib.root(in_root), ref_root) |
| 205 | + |
| 206 | +end |
| 207 | + |
| 208 | + |
194 | 209 | function test_with_suffix(tc) |
195 | 210 |
|
196 | 211 | tc.verifyEqual(stdlib.with_suffix("", ""), "") |
|
0 commit comments