1616
1717properties (TestParameter )
1818str = {" string" , ' char' }
19- type = {" single" , " double" , ...
20- " int8" , " int16" , " int32" , " int64" , ...
21- " uint8" , " uint16" , " uint32" , " uint64" , " string" }
19+ type = {' single' , ' double' , ...
20+ ' int8' , ' int16' , ' int32' , ' int64' , ...
21+ ' uint8' , ' uint16' , ' uint32' , ' uint64' , ' string' }
2222end
2323
2424methods (TestClassSetup )
@@ -34,9 +34,9 @@ function setupData(tc)
3434methods (TestMethodSetup )
3535
3636function setup_file(tc )
37- tc .applyFixture(matlab .unittest .fixtures .WorkingFolderFixture())
37+ tc .applyFixture(matlab .unittest .fixtures .WorkingFolderFixture());
3838
39- tc.file = fullfile( pwd(), class(tc ) + " .h5" ) ;
39+ tc.file = [ pwd(), class(tc ), ' .h5' ] ;
4040
4141% create test data first, so that parallel tests works
4242stdlib .h5save(tc .file , ' /A0' , tc .A0 )
@@ -57,13 +57,12 @@ function setup_file(tc)
5757stdlib .h5save(tc .file , ' /t/y' , 13 )
5858stdlib .h5save(tc .file , ' /j/a/b' , 6 )
5959
60- tc .assertThat(tc .file , matlab .unittest .constraints .IsFile )
6160end
6261
6362end
6463
6564
66- methods (Test , TestTags = {' R2019b ' })
65+ methods (Test , TestTags = {' R2017b ' })
6766
6867function test_auto_chunk_size(tc )
6968
@@ -89,19 +88,19 @@ function test_get_variables(tc)
8988tc .verifyEqual(sort(v ), k )
9089
9190% 1-level group
92- v = stdlib .h5variables(tc .file , " /t " );
91+ v = stdlib .h5variables(tc .file , ' /t ' );
9392tc .verifyEqual(sort(v ), [" x" , " y" ])
9493
9594% traversal
96- tc .verifyEmpty(stdlib .h5variables(tc .file , " /j " ) )
95+ tc .verifyEmpty(stdlib .h5variables(tc .file , ' /j ' ) )
9796
98- tc .verifyEqual(stdlib .h5variables(tc .file , " /j/a" ) , " b" )
97+ tc .verifyEqual(stdlib .h5variables(tc .file , ' /j/a' ) , " b" )
9998
10099end
101100
102101
103102function test_exists(tc )
104- e = stdlib .h5exists(tc .file , " /A0" );
103+ e = stdlib .h5exists(tc .file , ' /A0' );
105104
106105tc .verifyThat(e , matlab .unittest .constraints .IsScalar )
107106tc .verifyTrue(e );
@@ -178,11 +177,11 @@ function test_read(tc)
178177
179178function test_shape(tc )
180179
181- stdlib .h5save(tc .file , " /vector1" , 34 , " size" , 1 )
180+ stdlib .h5save(tc .file , ' /vector1' , 34 , " size" , 1 )
182181s = stdlib .h5size(tc .file , ' /vector1' );
183182tc .verifyEqual(s , 1 );
184183
185- stdlib .h5save(tc .file , " /scalar" , 34 , " size" , 0 )
184+ stdlib .h5save(tc .file , ' /scalar' , 34 , " size" , 0 )
186185s = stdlib .h5size(tc .file , ' /scalar' );
187186tc .verifyEmpty(s );
188187
@@ -195,14 +194,14 @@ function test_coerce(tc, type)
195194 tc .assumeFalse(stdlib .matlabOlderThan(" R2020b" ))
196195end
197196
198- stdlib .h5save(tc .file , " / " + type , 0 , " type" , type )
197+ stdlib .h5save(tc .file , [ ' / ' , type ] , 0 , " type" , type )
199198
200199switch type
201200case " string" , vt = ' char' ;
202201otherwise , vt = type ;
203202end
204203
205- tc .verifyClass(h5read(tc .file , " / " + type ), vt )
204+ tc .verifyClass(h5read(tc .file , [ ' / ' , type ] ), vt )
206205
207206end
208207
@@ -216,33 +215,33 @@ function test_rewrite(tc)
216215
217216function test_int8(tc )
218217
219- stdlib .h5save(tc .file , " /i1" , int8(127 ))
218+ stdlib .h5save(tc .file , ' /i1' , int8(127 ))
220219
221- a = h5read(tc .file , " /i1" );
220+ a = h5read(tc .file , ' /i1' );
222221tc .verifyEqual(a , int8(127 ))
223222
224223% test rewrite
225- stdlib .h5save(tc .file , " /i1" , int8(-128 ))
224+ stdlib .h5save(tc .file , ' /i1' , int8(-128 ))
226225
227- a = h5read(tc .file , " /i1" );
226+ a = h5read(tc .file , ' /i1' );
228227tc .verifyEqual(a , int8(-128 ))
229228
230229% test int8 array
231- stdlib .h5save(tc .file , " /Ai1" , int8([1 , 2 ]))
232- a = h5read(tc .file , " /Ai1" );
230+ stdlib .h5save(tc .file , ' /Ai1' , int8([1 , 2 ]))
231+ a = h5read(tc .file , ' /Ai1' );
233232tc .verifyEqual(a , int8([1 ;2]))
234233end
235234
236235function test_real_only(tc )
237236
238- tc .verifyError(@() stdlib .h5save(tc .file , " /bad_imag" , 1j ), ' MATLAB:validators:mustBeReal' )
237+ tc .verifyError(@() stdlib .h5save(tc .file , ' /bad_imag' , 1j ), ' MATLAB:validators:mustBeReal' )
239238tc .verifyError(@() stdlib .h5variables(tc .file , ' /nothere' ), ' MATLAB:imagesci:h5info:unableToFind' )
240239end
241240
242241end
243242
244243
245- methods (Test , TestTags = [ " R2020b" , " hdf5 "] )
244+ methods (Test , TestTags = { ' R2020b' } )
246245
247246function test_string(tc , str )
248247tc .assumeFalse(stdlib .matlabOlderThan(" R2020b" ))
0 commit comments