Skip to content

Commit b514c0a

Browse files
committed
test: which: check assumptions
1 parent 4260434 commit b514c0a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

+stdlib/which.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
return
2828
end
2929

30-
% relative directory component, but path was not a file
30+
% relative directory component, but path was not an executable file
3131
if ~strcmp(stdlib.filename(cmd), cmd)
3232
return
3333
end

test/TestWhich.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ function test_which_absolute(tc, mexe)
3939
end
4040

4141
tc.assumeThat(r, matlab.unittest.constraints.IsFile)
42+
tc.assumeTrue(stdlib.is_exe(r))
4243

43-
tc.verifyEqual(stdlib.which(mexe), r)
44+
tc.verifyGreaterThan(strlength(stdlib.which(r)), 0, "Expected which(" + r + " ) to find " + r)
45+
tc.verifyGreaterThan(strlength(stdlib.which(mexe)), 0, "Expected which(" + mexe + ") to find " + r)
4446

4547
end
4648

0 commit comments

Comments
 (0)