Skip to content

Commit 989dbe2

Browse files
committed
test: assert File
1 parent 21f16d7 commit 989dbe2

File tree

9 files changed

+13
-19
lines changed

9 files changed

+13
-19
lines changed

test/TestDisk.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
methods(Test, TestTags = "mex")
88

99
function test_mex_disk_available(tc)
10-
import matlab.unittest.constraints.IsFile
11-
tc.assertThat(fileparts(mfilename("fullpath")) + "/../+stdlib/disk_available." + mexext, IsFile)
10+
tc.assertTrue(stdlib.is_mex_fun("stdlib.disk_available"))
1211
end
1312

1413
function test_mex_disk_capacity(tc)
15-
import matlab.unittest.constraints.IsFile
16-
tc.assertThat(fileparts(mfilename("fullpath")) + "/../+stdlib/disk_capacity." + mexext, IsFile)
14+
tc.assertTrue(stdlib.is_mex_fun("stdlib.disk_capacity"))
1715
end
1816

1917
end

test/TestHDF4.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
function setup_file(tc)
99
import matlab.unittest.constraints.IsFile
1010
tc.TestData.basic = fullfile(matlabroot, "toolbox/matlab/demos/example.hdf");
11-
tc.assumeThat(tc.TestData.basic, IsFile)
11+
tc.assertThat(tc.TestData.basic, IsFile)
1212
end
1313
end
1414

test/TestHDF5.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function setup_file(tc)
5050
stdlib.h5save(bf, '/t/y', 13)
5151
stdlib.h5save(bf, '/j/a/b', 6)
5252

53-
tc.assumeThat(bf, matlab.unittest.constraints.IsFile)
53+
tc.assertThat(bf, matlab.unittest.constraints.IsFile)
5454
end
5555
end
5656

test/TestHash.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function test_hash_text(tc, Ph)
2020
fprintf(fid, "hello");
2121
fclose(fid);
2222

23-
tc.assumeThat(fn, matlab.unittest.constraints.IsFile)
23+
tc.assertThat(fn, matlab.unittest.constraints.IsFile)
2424

2525
tc.verifyEqual(stdlib.file_checksum(fn, Ph{1}), Ph{2})
2626

test/TestIni.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function test_example(tc)
99
cwd = fileparts(mfilename('fullpath'));
1010
example = cwd + "/example.ini";
1111

12-
tc.assumeThat(example, IsFile)
12+
tc.assertThat(example, IsFile)
1313

1414
s = stdlib.ini2struct(example);
1515
tc.verifyClass(s, 'struct')

test/TestMex.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function test_is_admin(tc)
2020

2121

2222
function test_remove_file(tc)
23-
tc.assertThat(stdlib.is_mex_fun("stdlib.remove"))
23+
tc.assertTrue(stdlib.is_mex_fun("stdlib.remove"))
2424

2525
d = tc.createTemporaryFolder();
2626

@@ -34,8 +34,7 @@ function test_remove_file(tc)
3434

3535

3636
function test_remove_empty_dir(tc)
37-
import matlab.unittest.constraints.IsFile
38-
tc.assertThat(fileparts(mfilename("fullpath")) + "/../+stdlib/remove." + mexext, IsFile)
37+
tc.assertTrue(stdlib.is_mex_fun("stdlib.remove"))
3938

4039
d = tc.createTemporaryFolder();
4140

@@ -44,8 +43,7 @@ function test_remove_empty_dir(tc)
4443

4544

4645
function test_remove_recursive(tc)
47-
import matlab.unittest.constraints.IsFile
48-
tc.assertThat(fileparts(mfilename("fullpath")) + "/../+stdlib/remove." + mexext, IsFile)
46+
tc.assertTrue(stdlib.is_mex_fun("stdlib.remove"))
4947

5048
d = tc.createTemporaryFolder();
5149

test/TestNetCDF.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function setup_file(tc)
4747
stdlib.ncsave(basic, '/t/y', 13)
4848
stdlib.ncsave(basic, '/j/a/b', 6)
4949

50-
tc.assumeThat(basic, matlab.unittest.constraints.IsFile)
50+
tc.assertThat(basic, matlab.unittest.constraints.IsFile)
5151
end
5252
end
5353

test/TestNormalize.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function test_drop_slash(tc, d)
7171
d = [d, dd];
7272
end
7373

74-
if ~isfile(fileparts(mfilename("fullpath")) + "/../+stdlib/drop_slash." + mexext)
74+
if ~stdlib.is_mex_fun("stdlib.normalize")
7575

7676
dd = {...
7777
{'a', 'a'}, ...

test/TestRelative.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
methods (Test, TestTags = "mex")
99

1010
function test_relative_to(tc, pr)
11-
import matlab.unittest.constraints.IsFile
12-
tc.assertThat(fileparts(mfilename("fullpath")) + "/../+stdlib/relative_to." + mexext, IsFile)
11+
tc.assertTrue(stdlib.is_mex_fun("stdlib.relative_to"))
1312

1413
tc.verifyEqual(stdlib.relative_to(pr{1}, pr{2}), pr{3}, ...
1514
"relative_to(" + pr{1} + "," + pr{2}+")")
1615
end
1716

1817
function test_proximate_to(tc, pp)
19-
import matlab.unittest.constraints.IsFile
20-
tc.assertThat(fileparts(mfilename("fullpath")) + "/../+stdlib/proximate_to." + mexext, IsFile)
18+
tc.assertTrue(stdlib.is_mex_fun("stdlib.proximate_to"))
2119

2220
tc.verifyEqual(stdlib.proximate_to(pp{1}, pp{2}), pp{3}, ...
2321
"proximate_to(" + pp{1} + "," + pp{2}+")")

0 commit comments

Comments
 (0)