Skip to content

Commit 49d4a17

Browse files
committed
ci: function based tests
1 parent b6ac140 commit 49d4a17

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

+hdf5nc/test_hdf5.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function test_get_variables(tc)
4646

4747
function test_exists(tc)
4848
e0 = hdf5nc.h5exists(tc.TestData.basic, '/A3');
49-
assert(isscalar(e0))
49+
assertSize(tc, e0, [1,1])
5050
assertTrue(tc, e0, 'A3 exists')
5151

5252
assertFalse(tc, hdf5nc.h5exists(tc.TestData.basic, '/oops'), 'oops not exist')
@@ -62,11 +62,11 @@ function test_size(tc)
6262
basic = tc.TestData.basic;
6363

6464
s = h5size(basic, '/A0');
65-
assert(isscalar(s))
65+
assertSize(tc, s, [1,1])
6666
assertEqual(tc, s, 1, 'A0 shape')
6767

6868
s = h5size(basic, '/A1');
69-
assert(isscalar(s))
69+
assertSize(tc, s, [1,1])
7070
assertEqual(tc, s, 2, 'A1 shape')
7171

7272
s = h5size(basic, '/A2');
@@ -86,7 +86,7 @@ function test_size(tc)
8686
function test_read(tc)
8787
basic = tc.TestData.basic;
8888
s = h5read(basic, '/A0');
89-
assert(isscalar(s))
89+
assertSize(tc, s, [1,1])
9090
assertEqual(tc, s, 42, 'A0 read')
9191

9292
s = h5read(basic, '/A1');

+hdf5nc/test_netcdf.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function test_get_variables(tc)
3939

4040
function test_exists(tc)
4141
e0 = hdf5nc.ncexists(tc.TestData.basic, 'A3');
42-
assert(isscalar(e0))
42+
assertSize(tc, e0, [1,1])
4343
assertTrue(tc, e0, 'A3 exists')
4444

4545
assertFalse(tc, hdf5nc.ncexists(tc.TestData.basic, '/oops'), 'oops not exist')
@@ -54,11 +54,11 @@ function test_size(tc)
5454
basic = tc.TestData.basic;
5555

5656
s = ncsize(basic, 'A0');
57-
assert(isscalar(s))
57+
assertSize(tc, s, [1,1])
5858
assertEqual(tc, s, 1, 'A0 shape')
5959

6060
s = ncsize(basic, 'A1');
61-
assert(isscalar(s))
61+
assertSize(tc, s, [1,1])
6262
assertEqual(tc, s, 2, 'A1 shape')
6363

6464
s = ncsize(basic, 'A2');
@@ -79,7 +79,7 @@ function test_read(tc)
7979
basic = tc.TestData.basic;
8080

8181
s = ncread(basic, '/A0');
82-
assert(isscalar(s))
82+
assertSize(tc, s, [1,1])
8383
assertEqual(tc, s, 42, 'A0 read')
8484

8585
s = ncread(basic, '/A1');

0 commit comments

Comments
 (0)