Skip to content

Commit

Permalink
is_regular_file, null_file: config tests for Windows behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Sep 12, 2024
1 parent ea3811c commit a52c568
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/TestFileImpure.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ function test_expanduser(tc, in_expand, ref_expand)


function test_null_file(tc)
tc.assumeFalse(ispc)
tc.verifyTrue(isfile(stdlib.null_file), "Null file not exist")
end


function test_is_regular_file(tc)

tc.assumeTrue(isfile(stdlib.null_file), "null file not exist")
if ~ispc
tc.assumeTrue(isfile(stdlib.null_file), "null file not exist")
end
tc.verifyFalse(stdlib.is_regular_file(stdlib.null_file), "null file is not a regular file")

end
Expand Down Expand Up @@ -153,7 +156,10 @@ function test_canonical(tc)
r = stdlib.parent(mfilename('fullpath'));
tc.verifyEqual(stdlib.canonical(fullfile(r, "..")), stdlib.parent(r))

% on windows, ~ is expanded even without expanduser
if ~ispc
tc.verifyThat(stdlib.canonical("~", false), EndsWithSubstring("~"))
end

h = stdlib.homedir;
tc.verifyEqual(stdlib.canonical("~"), h)
Expand Down

0 comments on commit a52c568

Please sign in to comment.