|
1 | 1 | classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ... |
2 | | - TestTags = {'pure'}) ... |
| 2 | + TestTags = {'R2019a', 'pure'}) ... |
3 | 3 | TestWithSuffix < matlab.unittest.TestCase |
4 | 4 |
|
5 | 5 |
|
|
10 | 10 | {"", ".nc", ".nc"}, ... |
11 | 11 | {"hello.txt.gz", ".bz", "hello.txt.bz"}, ... |
12 | 12 | {"a/b.c/hello.txt", ".gz", "a/b.c/hello.gz"}, ... |
13 | | -{'a/b/', '.h5', "a/b/.h5"}, ... |
| 13 | +{'a/b/', '.h5', 'a/b/.h5'}, ... |
14 | 14 | {"a/b/.h5", '.nc', "a/b/.h5.nc"}, ... |
15 | 15 | {".h5", ".nc", ".h5.nc"}, ... |
16 | | -{'a/b', '.nc', "a/b.nc"}}; |
| 16 | +{'a/b', '.nc', 'a/b.nc'}}; |
17 | 17 | end |
18 | 18 |
|
19 | 19 |
|
20 | | -methods (Test, TestTags={'R2019b'}) |
| 20 | +methods (Test) |
21 | 21 | function test_with_suffix(tc, p) |
22 | | - |
23 | | -r = p{3}; |
24 | | - |
25 | | -tc.verifyEqual(stdlib.with_suffix(p{1}, p{2}), r) |
26 | | -end |
27 | | -end |
28 | | - |
29 | | - |
30 | | -methods (Test, TestTags={'R2020b'}) |
31 | | - |
32 | | -function test_with_suffix_array(tc) |
33 | | -tc.assumeFalse(stdlib.matlabOlderThan('R2020b')) |
34 | | -in = ["", ".txt", "a/b/c.txt", "a/b/c.txt.gz", "a/b/c"]; |
35 | | -new = [".txt", ".gz", "", ".bz", ".nc"]; |
36 | | -exp = [".txt", ".txt.gz", "a/b/c", "a/b/c.txt.bz", "a/b/c.nc"]; |
37 | | -out = stdlib.with_suffix(in, new); |
38 | | -tc.verifyEqual(out, exp) |
| 22 | +tc.verifyEqual(stdlib.with_suffix(p{1}, p{2}), p{3}) |
39 | 23 | end |
40 | 24 | end |
41 | 25 |
|
|
0 commit comments