|
11 | 11 | ref_proximate_to
|
12 | 12 | in_is_absolute
|
13 | 13 | ref_is_absolute
|
14 |
| -in_filename = {'', '/foo/bar/baz', '/foo/bar/baz/', 'foo/bar/baz.txt', 'foo/bar/baz.txt.gz'}; |
15 |
| -ref_filename = {'', 'baz', '', 'baz.txt', 'baz.txt.gz'}; |
| 14 | +in_filename = {'', '/foo/bar/baz', '/foo/bar/baz/', 'foo/bar/baz.txt', 'foo/bar/baz.txt.gz'} |
| 15 | +ref_filename = {'', 'baz', '', 'baz.txt', 'baz.txt.gz'} |
16 | 16 | dir_is_subdir
|
17 | 17 | sub_is_subdir
|
18 | 18 | ref_is_subdir
|
| 19 | +in_parent = {"", ".", "..", "../..", "a/b", "a/b/", "ab/.parent", "ab/.parent.txt", "a/b/../.parent.txt"} |
| 20 | +ref_parent = {".", ".", ".", "..", "a", "a", "ab", "ab", "a/b/.."} |
| 21 | +in_suffix = {"", "/foo/bar/baz", "/foo/bar/baz/", "foo/bar/baz.txt", "foo/bar/baz.txt.gz", ".stat", ".stat.txt"} |
| 22 | +ref_suffix = {"", "", "", ".txt", ".gz", ".stat", ".txt"} |
19 | 23 | end
|
20 | 24 |
|
21 | 25 | properties
|
@@ -143,28 +147,12 @@ function test_filename(tc, in_filename, ref_filename)
|
143 | 147 | end
|
144 | 148 |
|
145 | 149 |
|
146 |
| -function test_parent(tc) |
147 |
| - |
148 |
| -tc.verifyEqual(stdlib.parent(""), "") |
149 |
| - |
150 |
| -tc.verifyEqual(stdlib.parent("/foo/bar/baz"), "/foo/bar") |
151 |
| -tc.verifyEqual(stdlib.parent("/foo/bar/baz/"), "/foo/bar") |
152 |
| - |
153 |
| -tc.verifyEqual(stdlib.parent("foo/bar/baz/"), "foo/bar") |
154 |
| - |
| 150 | +function test_parent(tc, in_parent, ref_parent) |
| 151 | +tc.verifyEqual(stdlib.parent(in_parent), ref_parent) |
155 | 152 | end
|
156 | 153 |
|
157 |
| -function test_suffix(tc) |
158 |
| - |
159 |
| -tc.verifyEmpty(stdlib.suffix(string.empty)) |
160 |
| -tc.verifyEqual(stdlib.suffix(""), "") |
161 |
| - |
162 |
| -tc.verifyEqual(stdlib.suffix("/foo/bar/baz"), "") |
163 |
| -tc.verifyEqual(stdlib.suffix("/foo/bar/baz/"), "") |
164 |
| - |
165 |
| -tc.verifyEqual(stdlib.suffix("foo/bar/baz.txt"), ".txt") |
166 |
| -tc.verifyEqual(stdlib.suffix("foo/bar/baz.txt.gz"), ".gz") |
167 |
| - |
| 154 | +function test_suffix(tc, in_suffix, ref_suffix) |
| 155 | +tc.verifyEqual(stdlib.suffix(in_suffix), string(ref_suffix)) |
168 | 156 | end
|
169 | 157 |
|
170 | 158 |
|
|
0 commit comments