Skip to content

Commit 4185aaa

Browse files
committed
test:which: make more robust
1 parent 3b68402 commit 4185aaa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/TestFileImpure.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,16 @@ function test_which_name(tc)
231231

232232
tc.verifyEmpty(stdlib.which(tempname))
233233

234-
if ismac
235-
n = "ls";
234+
if ispc
235+
n = "pwsh.exe";
236236
else
237-
n = "matlab";
237+
n = "ls";
238238
end
239239
%% which: Matlab in environment variable PATH
240240
% MacOS Matlab does not source .zshrc so Matlab is not on internal Matlab PATH
241+
% Unix-like OS may have Matlab as alias which is not visible to
242+
% stdlib.which()
243+
% virus scanners may block stdlib.which("cmd.exe") on Windows
241244
tc.verifyNotEmpty(stdlib.which(n))
242245

243246
end

0 commit comments

Comments
 (0)