Skip to content

Commit 01de948

Browse files
committed
test: enable more old versions
1 parent d709a3c commit 01de948

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

+stdlib/file_checksum.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
% Ref: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/security/MessageDigest.html#getInstance(java.lang.String)
1414

1515
function [r, b] = file_checksum(file, hash_method, backend)
16-
arguments
17-
file
18-
hash_method
19-
backend (1,:) string = ["java", "dotnet", "sys"]
16+
if nargin < 3
17+
backend = ["java", "dotnet", "sys"];
18+
else
19+
backend = string(backend);
2020
end
2121

2222
r = '';

test/TestAbsolute.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
methods(TestClassSetup)
1212
function test_dirs(tc)
13-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
13+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
1414
end
1515
end
1616

test/TestCanonical.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
2-
TestTags = {'R2018a'}) ...
2+
TestTags = {'R2017b'}) ...
33
TestCanonical < matlab.unittest.TestCase
44

55
properties (TestParameter)
66
p = {{'', ''}, ...
77
{"", ""}, ...
88
{"not-exist", "not-exist"}, ...
99
{'a/../b', 'a/../b'}, ...
10-
{[mfilename("fullpath"), '.m/..'], fileparts(mfilename("fullpath"))}, ...
1110
{"not-exist/a/..", "not-exist/a/.."}, ...
1211
{"./not-exist", "not-exist"}
1312
};
1413
end
1514

1615
methods (TestClassSetup)
1716
function test_dirs(tc)
18-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
17+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
1918
end
2019
end
2120

@@ -26,6 +25,11 @@ function test_canonical(tc, p)
2625
tc.verifyEqual(c, p{2})
2726
end
2827

28+
function test_canonical_cwd(tc)
29+
c = stdlib.canonical('.', true);
30+
tc.verifyEqual(c, pwd())
31+
end
32+
2933
end
3034

3135
end

test/TestExists.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
methods(TestClassSetup)
1111
function test_dirs(tc)
12-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
12+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
1313
end
1414
end
1515

test/TestFileImpure.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
methods(TestClassSetup)
1010
function test_dirs(tc)
11-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
11+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
1212
end
1313
end
1414

test/TestFilePure.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
2-
TestTags = {'R2019b', 'pure'}) ...
2+
TestTags = {'R2017b', 'pure'}) ...
33
TestFilePure < matlab.unittest.TestCase
44

55

test/TestHash.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
2-
TestTags = {'R2019b', 'impure'}) ...
2+
TestTags = {'R2017b', 'impure'}) ...
33
TestHash < matlab.unittest.TestCase
44

55
properties
@@ -15,7 +15,7 @@
1515

1616
methods(TestClassSetup)
1717
function create_file(tc)
18-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
18+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
1919

2020
tc.file = fullfile(pwd(), class(tc));
2121

test/TestResolve.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
methods(TestClassSetup)
1010
function test_dirs(tc)
11-
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture())
11+
tc.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture());
1212
end
1313
end
1414

0 commit comments

Comments
 (0)