Mercurial > hg > octave-nkf
diff scripts/testfun/demo.m @ 15520:bcace51598ed
Improve demo() to warn when an input function does not exist.
* demo.m: Check return code from test to see whether function
exists and issue a warning if it does not.
* test.m: Return -1 for second retval when grabdemo option given and function
does not exist.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 14 Oct 2012 20:18:22 -0700 |
parents | dda73cb60ac5 |
children | 333243133364 |
line wrap: on
line diff
--- a/scripts/testfun/demo.m +++ b/scripts/testfun/demo.m @@ -101,7 +101,11 @@ endif [code, idx] = test (name, "grabdemo"); - if (isempty (idx)) + + if (idx == -1) + warning ("no function %s found", name); + return; + elseif (isempty (idx)) warning ("no demo available for %s", name); return; elseif (n >= length (idx))