File tree Expand file tree Collapse file tree 7 files changed +38
-15
lines changed Expand file tree Collapse file tree 7 files changed +38
-15
lines changed Original file line number Diff line number Diff line change 1212 use_java (1 ,1 ) logical = false
1313end
1414
15+
1516if use_java
1617
1718% https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/nio/file/Files.html#exists(java.nio.file.Path,java.nio.file.LinkOption...)
Original file line number Diff line number Diff line change 55end
66
77methods (TestClassSetup )
8+
89function setup_path(tc )
10+ import matlab .unittest .fixtures .PathFixture
11+ cwd = fileparts(mfilename(" fullpath" ));
12+ top = fullfile(cwd , " .." );
13+ tc .applyFixture(PathFixture(top ))
14+ end
15+
16+ function setup_file(tc )
917import matlab .unittest .constraints .IsFile
1018tc.TestData.basic = fullfile(matlabroot , " toolbox/matlab/demos/example.hdf" );
1119tc .assumeThat(tc .TestData .basic , IsFile )
Original file line number Diff line number Diff line change 77
88methods (TestClassSetup )
99
10- function has_java(tc )
11- tc .assumeTrue(stdlib .has_java )
12- end
13-
1410function setup_path(tc )
1511import matlab .unittest .fixtures .PathFixture
1612cwd = fileparts(mfilename(" fullpath" ));
1713top = fullfile(cwd , " .." );
1814tc .applyFixture(PathFixture(top ))
15+
16+ tc .assumeTrue(stdlib .has_java )
1917end
18+
2019end
2120
2221methods (Test , ParameterCombination = ' sequential' )
Original file line number Diff line number Diff line change 22
33methods (TestClassSetup )
44
5- function has_java(tc )
6- tc .assumeTrue(stdlib .has_java )
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+ tc .assumeTrue(stdlib .has_java )
712end
813
914end
Original file line number Diff line number Diff line change 22
33methods (TestClassSetup )
44
5- function has_java(tc )
6- tc .assumeTrue(stdlib .has_java )
7- end
8-
95function setup_path(tc )
106import matlab .unittest .fixtures .PathFixture
117cwd = fileparts(mfilename(" fullpath" ));
128top = fullfile(cwd , " .." );
139tc .applyFixture(PathFixture(top ))
10+
11+ tc .assumeTrue(stdlib .has_java )
1412end
13+
1514end
1615
1716methods (Test )
Original file line number Diff line number Diff line change 22
33methods (TestClassSetup )
44
5- function has_java(tc )
6- tc .assumeTrue(stdlib .has_java )
7- end
8-
95function setup_path(tc )
106import matlab .unittest .fixtures .PathFixture
117cwd = fileparts(mfilename(" fullpath" ));
128top = fullfile(cwd , " .." );
139tc .applyFixture(PathFixture(top ))
10+
11+ tc .assumeTrue(stdlib .has_java )
1412end
13+
1514end
1615
1716methods (Test )
Original file line number Diff line number Diff line change 11classdef TestWhich < 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+ end
11+
12+ end
13+
14+
315methods (Test )
416
517function test_which_name(tc )
@@ -51,4 +63,4 @@ function test_is_exe_which_fullpath(tc)
5163
5264end
5365
54- end
66+ end
You can’t perform that action at this time.
0 commit comments