Skip to content

Commit 1904550

Browse files
committed
test: remove unused logic
1 parent 50895e5 commit 1904550

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed

Readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ Matlab or
1010
users coming from other languages will benefit from the functionality contained within this user-developed, unofficial "stdlib" standard library of functions.
1111
These system, filesystem, and HDF5 / HDF4 / NetCDF functions are used across numerous projects.
1212

13-
Matlab R2019b is the minimum required due to use of
14-
[arguments](https://www.mathworks.com/help/matlab/ref/arguments.html)
15-
syntax.
13+
Matlab R2020b is the minimum required version.
1614
URLs (e.g. https://, s3:// and similar) are treated as not existing.
1715
The self-tests require at least Matlab R2022a and can be run from the matlab-stdlib/ directory.
1816

test/TestHDF5.m

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ function setup_file(tc)
4343
stdlib.h5save(bf, '/A3', A3, "size", size(A3))
4444
stdlib.h5save(bf, '/A4', A4)
4545

46-
if ~isMATLABReleaseOlderThan("R2020b")
4746
stdlib.h5save(bf, "/utf", utf)
4847
stdlib.h5save(bf, "/utf2", utf2)
49-
end
5048

5149
stdlib.h5save(bf, '/t/x', 12)
5250
stdlib.h5save(bf, '/t/y', 13)
@@ -72,11 +70,7 @@ function test_get_variables(tc)
7270
basic = tc.TestData.basic;
7371

7472
v = stdlib.h5variables(basic);
75-
k = ["A0", "A1", "A2", "A3", "A4"];
76-
77-
if ~isMATLABReleaseOlderThan("R2020b")
78-
k = [k, "utf", "utf2"];
79-
end
73+
k = ["A0", "A1", "A2", "A3", "A4", "utf", "utf2"];
8074

8175
tc.verifyEqual(sort(v), k)
8276

@@ -127,13 +121,11 @@ function test_size(tc)
127121
tc.verifyTrue(isvector(s))
128122
tc.verifyEqual(s, [4,3,2,5])
129123

130-
if ~isMATLABReleaseOlderThan("R2020b")
131124
s = stdlib.h5size(basic, '/utf');
132125
tc.verifyEmpty(s)
133126

134127
s = stdlib.h5size(basic, '/utf2');
135128
tc.verifyEqual(s, 2)
136-
end
137129

138130
end
139131

@@ -163,15 +155,13 @@ function test_read(tc)
163155
tc.verifyEqual(ndims(s), 4)
164156
tc.verifyEqual(s, tc.TestData.A4)
165157

166-
if ~isMATLABReleaseOlderThan("R2020b")
167158
s = h5read(basic, '/utf');
168159
tc.verifyTrue(ischar(s))
169160
tc.verifyEqual(s, tc.TestData.utf)
170161

171162
s = h5read(basic, '/utf2');
172163
tc.verifyClass(s, 'string')
173164
tc.verifyEqual(s, tc.TestData.utf2)
174-
end
175165

176166
end
177167

@@ -194,10 +184,6 @@ function test_shape(tc)
194184
function test_coerce(tc, type)
195185
basic = tc.TestData.basic;
196186

197-
if any(type == ["string", "char"])
198-
tc.assumeFalse(isMATLABReleaseOlderThan("R2020b"))
199-
end
200-
201187
stdlib.h5save(basic, "/" + type, 0, "type", type)
202188

203189
switch type
@@ -242,8 +228,6 @@ function test_int8(tc)
242228

243229
function test_string(tc, str)
244230

245-
tc.assumeFalse(isMATLABReleaseOlderThan("R2020b"))
246-
247231
basic = tc.TestData.basic;
248232

249233
stdlib.h5save(basic, "/"+str, str)

test/TestNetCDF.m

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ function setup_file(tc)
3939
stdlib.ncsave(basic, 'A3', A3, "dims", {'x3', size(A3,1), 'y3', size(A3,2), 'z3', size(A3,3)})
4040
stdlib.ncsave(basic, 'A4', A4, "dims", {'x4', size(A4,1), 'y4', size(A4,2), 'z4', size(A4,3), 'w4', size(A4,4)})
4141

42-
if ~isMATLABReleaseOlderThan('R2021b')
43-
stdlib.ncsave(basic, "utf0", utf0)
44-
stdlib.ncsave(basic, "utf1", utf1, "dims", {'s1', size(utf1, 1)})
45-
stdlib.ncsave(basic, "utf2", utf2, "dims", {'s1', size(utf2, 1), 't1', size(utf2, 2)})
46-
end
42+
stdlib.ncsave(basic, "utf0", utf0)
43+
stdlib.ncsave(basic, "utf1", utf1, "dims", {'s1', size(utf1, 1)})
44+
stdlib.ncsave(basic, "utf2", utf2, "dims", {'s1', size(utf2, 1), 't1', size(utf2, 2)})
4745

4846
stdlib.ncsave(basic, '/t/x', 12)
4947
stdlib.ncsave(basic, '/t/y', 13)
@@ -58,11 +56,7 @@ function setup_file(tc)
5856
function test_get_variables(tc)
5957
basic = tc.TestData.basic;
6058

61-
k = ["A0", "A1", "A2", "A3", "A4"];
62-
63-
if ~isMATLABReleaseOlderThan('R2021b')
64-
k = [k, ["utf0", "utf1", "utf2"]];
65-
end
59+
k = ["A0", "A1", "A2", "A3", "A4", "utf0", "utf1", "utf2"];
6660

6761
tc.verifyEqual(sort(stdlib.ncvariables(basic)), k)
6862

@@ -120,8 +114,6 @@ function test_size(tc)
120114
function test_size_string(tc)
121115
basic = tc.TestData.basic;
122116

123-
tc.assumeFalse(isMATLABReleaseOlderThan('R2021b'), "NetCDF4 string requires Matlab >= R2021b")
124-
125117
s = stdlib.ncsize(basic, 'utf0');
126118
tc.verifyEmpty(s)
127119

@@ -161,8 +153,6 @@ function test_read(tc)
161153
function test_read_string(tc)
162154
basic = tc.TestData.basic;
163155

164-
tc.assumeFalse(isMATLABReleaseOlderThan('R2021b'), "NetCDF4 string requires Matlab >= R2021b")
165-
166156
s = ncread(basic, 'utf0');
167157
tc.verifyClass(s, 'string')
168158
tc.verifyEqual(s, string(tc.TestData.utf0))

0 commit comments

Comments
 (0)