Mercurial > octave
changeset 28010:4f00900ac621
dir.m: Add regression BIST test (bug #57666).
* dir.m: Add regression BIST test for bug #57666.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Sun, 26 Jan 2020 19:28:56 -0800 |
parents | e3e26f54bfdc |
children | b31a118729ed |
files | scripts/miscellaneous/dir.m |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/dir.m Sun Jan 26 17:56:48 2020 -0800 +++ b/scripts/miscellaneous/dir.m Sun Jan 26 19:28:56 2020 -0800 @@ -223,6 +223,20 @@ %! endif %! end_unwind_protect +%!testif ; isunix () <*57666> +%! orig_dir = pwd (); +%! tmp_dir = tempname (); +%! unwind_protect +%! assert (mkdir (tmp_dir)); +%! list = dir (tmp_dir); +%! assert (list(1).name, "."); +%! assert (list(1).folder, canonicalize_file_name (tmp_dir)); +%! unwind_protect_cleanup +%! if (exist (tmp_dir)) +%! rmdir (tmp_dir); +%! endif +%! end_unwind_protect + ## Test input validation %!error <DIRECTORY argument must be a string> dir (1) %!warning <nonexistent directory> dir ("_%UNLIKELY_DIR_NAME%_");