Skip to content

Commit a3c5489

Browse files
committed
test fileio.which: accomodate Matlab on MacOS
1 parent 161e4af commit a3c5489

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

+stdlib/TestFileio.m

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,26 @@ function test_makedir(tc)
7676
tc.assertTrue(isfolder(d))
7777
end
7878

79-
function test_which(tc)
79+
function test_which_name(tc)
80+
import stdlib.fileio.which
81+
82+
if ismac
83+
n = "ls";
84+
else
85+
n = "matlab";
86+
end
87+
%% which: Matlab in environment variable PATH
88+
% MacOS Matlab does not source .zshrc so Matlab is not on internal Matlab PATH
89+
tc.verifyNotEmpty(which(n))
90+
91+
end
92+
93+
function test_is_exe_which_fullpath(tc)
8094
import matlab.unittest.constraints.IsFile
8195
import stdlib.fileio.which
8296
import stdlib.fileio.is_exe
8397

8498
n = "matlab";
85-
%% which: Matlab in environment variable PATH
86-
tc.verifyNotEmpty(which(n))
8799
%% is_exe test
88100
p = fullfile(matlabroot, "bin", n);
89101
if ispc

0 commit comments

Comments
 (0)