@@ -44,16 +44,10 @@ function setup_file(tc)
44
44
stdlib .h5save(bf , ' /A3' , A3 , " size" , size(A3 ))
45
45
stdlib .h5save(bf , ' /A4' , A4 )
46
46
47
- try
48
- if ~isMATLABReleaseOlderThan(" R2020b" )
47
+ if ~too_old(" R2020b" )
49
48
stdlib .h5save(bf , " /utf" , utf )
50
49
stdlib .h5save(bf , " /utf2" , utf2 )
51
50
end
52
- catch e
53
- if e .identifier ~= " MATLAB:UndefinedFunction"
54
- rethrow(e )
55
- end
56
- end
57
51
58
52
stdlib .h5save(bf , ' /t/x' , 12 )
59
53
stdlib .h5save(bf , ' /t/y' , 13 )
@@ -81,15 +75,9 @@ function test_get_variables(tc)
81
75
v = stdlib .h5variables(basic );
82
76
k = [" A0" , " A1" , " A2" , " A3" , " A4" ];
83
77
84
- try
85
- if ~isMATLABReleaseOlderThan(" R2020b" )
78
+ if ~too_old(" R2020b" )
86
79
k = [k , " utf" , " utf2" ];
87
80
end
88
- catch e
89
- if e .identifier ~= " MATLAB:UndefinedFunction"
90
- rethrow(e )
91
- end
92
- end
93
81
94
82
tc .verifyEqual(sort(v ), k )
95
83
@@ -140,19 +128,13 @@ function test_size(tc)
140
128
tc .verifyTrue(isvector(s ))
141
129
tc .verifyEqual(s , [4 ,3 ,2 ,5 ])
142
130
143
- try
144
- if ~isMATLABReleaseOlderThan(" R2020b" )
131
+ if ~too_old(" R2020b" )
145
132
s = stdlib .h5size(basic , ' /utf' );
146
133
tc .verifyEmpty(s )
147
134
148
135
s = stdlib .h5size(basic , ' /utf2' );
149
136
tc .verifyEqual(s , 2 )
150
137
end
151
- catch e
152
- if e .identifier ~= " MATLAB:UndefinedFunction"
153
- rethrow(e )
154
- end
155
- end
156
138
157
139
end
158
140
@@ -182,8 +164,7 @@ function test_read(tc)
182
164
tc .verifyEqual(ndims(s ), 4 )
183
165
tc .verifyEqual(s , tc .TestData .A4 )
184
166
185
- try
186
- if ~isMATLABReleaseOlderThan(" R2020b" )
167
+ if ~too_old(" R2020b" )
187
168
s = h5read(basic , ' /utf' );
188
169
tc .verifyTrue(ischar(s ))
189
170
tc .verifyEqual(s , tc .TestData .utf )
@@ -192,11 +173,6 @@ function test_read(tc)
192
173
tc .verifyThat(s , IsOfClass(' string' ))
193
174
tc .verifyEqual(s , tc .TestData .utf2 )
194
175
end
195
- catch e
196
- if e .identifier ~= " MATLAB:UndefinedFunction"
197
- rethrow(e )
198
- end
199
- end
200
176
201
177
end
202
178
@@ -219,7 +195,11 @@ function test_shape(tc)
219
195
function test_coerce(tc , type )
220
196
basic = tc .TestData .basic ;
221
197
222
- stdlib .h5save(basic , " /" +type , 0 , " type" ,type )
198
+ if any(type == [" string" , " char" ])
199
+ tc .assumeFalse(too_old(" R2020b" ))
200
+ end
201
+
202
+ stdlib .h5save(basic , " /" + type , 0 , " type" , type )
223
203
224
204
switch type
225
205
case " string" , vt = ' char' ;
@@ -265,6 +245,8 @@ function test_int8(tc)
265
245
266
246
function test_string(tc , str )
267
247
248
+ tc .assumeFalse(too_old(" R2020b" ))
249
+
268
250
basic = tc .TestData .basic ;
269
251
270
252
stdlib .h5save(basic , " /" +str , str )
0 commit comments