Mercurial > octave-nkf
comparison scripts/miscellaneous/unix.m @ 20550:76f67400649e
Use '-local' option to warning to simplify BIST tests.
* dos.m, unix.m, savepath.m, kurtosis.m, skewness.m:
Use '-local' option to warning instead of unwind/protect block.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 25 Sep 2015 21:00:29 -0700 |
parents | 4197fc428c7d |
children |
comparison
equal
deleted
inserted
replaced
20549:71e60880105a | 20550:76f67400649e |
---|---|
49 endfunction | 49 endfunction |
50 | 50 |
51 | 51 |
52 %!test | 52 %!test |
53 %! cmd = ls_command (); | 53 %! cmd = ls_command (); |
54 %! old_wstate = warning ("query"); | 54 %! warning ("off", "Octave:undefined-return-values", "local"); |
55 %! warning ("off", "Octave:undefined-return-values"); | 55 %! [status, output] = unix (cmd); |
56 %! unwind_protect | |
57 %! [status, output] = unix (cmd); | |
58 %! unwind_protect_cleanup | |
59 %! warning (old_wstate); | |
60 %! end_unwind_protect | |
61 %! | 56 %! |
62 %! if (isunix ()) | 57 %! if (isunix ()) |
63 %! assert (status, 0); | 58 %! assert (status, 0); |
64 %! assert (ischar (output)); | 59 %! assert (ischar (output)); |
65 %! assert (! isempty (output)); | 60 %! assert (! isempty (output)); |