33 TestWhich < matlab .unittest .TestCase
44
55properties (TestParameter )
6- mexe = {matlabroot + " /bin/matlab" , ...
6+ mexe = {[ matlabroot ' /bin/matlab' ] , ...
77 fullfile (matlabroot, 'bin/ matlab')}
88end
99
1010
11- methods (Test , TestTags = {' R2019b ' })
11+ methods (Test , TestTags = {' R2017b ' })
1212
1313function test_which_name(tc )
1414
@@ -27,7 +27,7 @@ function test_which_name(tc)
2727for n = names
2828 exe = stdlib .which(n );
2929 tc .verifyNotEmpty(exe , " Executable not found: " + n )
30- tc .verifyThat( exe , matlab . unittest . constraints . IsFile , " Executable is not a file: " + n )
30+ tc .verifyTrue(isfile( exe ) , " Executable is not a file: " + n )
3131 tc .verifyTrue(stdlib .is_exe(exe ), " Executable is not executable: " + n )
3232end
3333
@@ -36,12 +36,12 @@ function test_which_name(tc)
3636
3737function test_which_absolute(tc , mexe )
3838
39- r = string( mexe ) ;
39+ r = mexe ;
4040if ispc()
41- r = r + " .exe" ;
41+ r = [ r , ' .exe' ] ;
4242end
4343
44- tc .assumeThat( r , matlab . unittest . constraints . IsFile )
44+ tc .assumeTrue(isfile( r ) )
4545tc .assumeTrue(stdlib .is_exe(r ))
4646
4747tc .verifyGreaterThan(strlength(stdlib .which(r )), 0 , " Expected which(" + r + " ) to find " + r )
@@ -72,7 +72,7 @@ function testWhichNoPath(tc)
7272tc .applyFixture(fx )
7373
7474tc .verifyEmpty(stdlib .which(' matlab' ), " Matlab found by which() given empty path" )
75- tc .verifyNotEmpty(stdlib .which(' matlab' , matlabroot + " /bin" ))
75+ tc .verifyNotEmpty(stdlib .which(' matlab' , [ matlabroot , ' /bin' ] ))
7676end
7777end
7878
0 commit comments