Skip to content

Commit cbc105c

Browse files
committed
use PathFixture as tests don't need to be in package
1 parent 557464d commit cbc105c

15 files changed

+130
-323
lines changed

+stdlib/+sys/version_atleast.m

Lines changed: 0 additions & 29 deletions
This file was deleted.

+stdlib/+test/TestFilePure.m

Lines changed: 0 additions & 233 deletions
This file was deleted.

buildfile.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function checkTask(~)
1111
end
1212

1313
function testTask(~)
14-
r = runtests('stdlib.test', strict=true, UseParallel=false);
14+
r = runtests('test/', strict=true, UseParallel=false);
1515
% UseParallel can be a lot slower, especially on Mac
1616
assert(~isempty(r), "No tests were run")
1717
assertSuccess(r)

+stdlib/+test/TestFileImpure.m renamed to test/TestFileImpure.m

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
classdef TestFileImpure < matlab.unittest.TestCase
22

3+
methods(TestClassSetup)
4+
5+
function setup_path(tc)
6+
import matlab.unittest.fixtures.PathFixture
7+
cwd = fileparts(mfilename("fullpath"));
8+
top = fullfile(cwd, "..");
9+
tc.applyFixture(PathFixture(top))
10+
11+
end
12+
13+
end
14+
315
methods (Test)
416

517
function test_expanduser(tc)
618
import matlab.unittest.constraints.EndsWithSubstring
719
import matlab.unittest.constraints.StartsWithSubstring
8-
import stdlib.expanduser
920
tc.assumeTrue(usejava("jvm"), "Java required")
1021

11-
tc.verifyEmpty(expanduser(string.empty))
12-
tc.verifyEqual(expanduser(""), "")
22+
tc.verifyEmpty(stdlib.fileio.expanduser(string.empty))
23+
tc.verifyEqual(stdlib.fileio.expanduser(""), "")
1324

14-
tc.verifyEqual(expanduser("~abc"), "~abc")
25+
tc.verifyEqual(stdlib.fileio.expanduser("~abc"), "~abc")
1526

16-
tc.verifyThat(expanduser('~/foo'), ~StartsWithSubstring("~"))
27+
tc.verifyThat(stdlib.fileio.expanduser('~/foo'), ~StartsWithSubstring("~"))
1728

18-
tc.verifyThat(expanduser('~/foo'), EndsWithSubstring("foo"))
29+
tc.verifyThat(stdlib.fileio.expanduser('~/foo'), EndsWithSubstring("foo"))
1930
end
2031

2132

0 commit comments

Comments
 (0)