Mercurial > hg > octave-nkf
changeset 14406:98cf8aa9f8ba
prepad.m: Improve input validation messages and tests.
* prepad.m: Improve input validation messages and tests.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 24 Feb 2012 18:16:35 -0800 |
parents | 7d5a653825b9 |
children | e3dbcb75f557 |
files | scripts/general/prepad.m |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/prepad.m +++ b/scripts/general/prepad.m @@ -46,7 +46,7 @@ c = 0; else if (! isscalar (c)) - error ("prepad: third argument must be empty or a scalar"); + error ("prepad: pad value C must be empty or a scalar"); endif endif @@ -63,7 +63,7 @@ endif if (! isscalar (l) || l < 0) - error ("prepad: second argument must be a positive scaler"); + error ("prepad: length L must be a positive scalar"); endif if (dim > nd) @@ -97,5 +97,10 @@ %!error prepad () %!error prepad (1) %!error prepad (1,2,3,4,5) -%!error prepad ([1,2], 2, 2,3) +%!error <C must be empty or a scalar> prepad ([1,2], 2, ones (2)) +%!error <DIM must be an integer> prepad ([1,2], 2, 2, ones (3)) +%!error <DIM must be an integer> prepad ([1,2], 2, 2, 1.1) +%!error <DIM must be an integer> prepad ([1,2], 2, 2, 3) +%!error <L must be a positive scalar> prepad ([1,2], ones (2)) +%!error <L must be a positive scalar> prepad ([1,2], -1)