Skip to content

Commit 7630cbb

Browse files
committed
test:windows_shortpath: more robust compare
1 parent 230c86c commit 7630cbb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/TestWindowsCOM.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function test_not(tc, Pn)
1414
function test_short_folder(tc)
1515
import matlab.unittest.constraints.IsFolder
1616

17-
progdir = stdlib.posix(getenv("PROGRAMFILES"));
17+
progdir = getenv("PROGRAMFILES");
1818
if ispc()
1919
tc.assertThat(progdir, IsFolder, "$Env:PROGRAMFILES is not a directory")
2020
end
@@ -40,7 +40,12 @@ function test_short_file(tc, Pmr)
4040
if contains(Pmr, " ")
4141
tc.verifySubstring(s, "~")
4242
end
43-
tc.verifyEqual(stdlib.canonical(s), stdlib.posix(Pmr), "shortname didn't resolve same as canonical")
43+
44+
% CI systems like GitHub Actions might not shorten despite long path components
45+
tc.verifyLessThanOrEqual(strlength(s), strlength(Pmr))
46+
47+
tc.verifyTrue(stdlib.samepath(stdlib.canonical(s), Pmr),...
48+
sprintf("mex: %d", stdlib.is_mex_fun("stdlib.windows_shortname")))
4449
else
4550
tc.verifyEqual(s, string(Pmr))
4651
end

0 commit comments

Comments
 (0)