Mercurial > octave-nkf
changeset 12854:4e9576618df8
codesprint: Wrote 2 tests for polyint.m
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> |
---|---|
date | Sat, 16 Jul 2011 18:12:37 -0500 |
parents | 7869cc61ce90 |
children | 8f5bd903ba68 |
files | scripts/polynomial/polyint.m |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/polynomial/polyint.m Sat Jul 16 18:08:22 2011 -0500 +++ b/scripts/polynomial/polyint.m Sat Jul 16 18:12:37 2011 -0500 @@ -61,3 +61,18 @@ retval = [(p ./ [lp:-1:1]), k]; endfunction + +%!test +%! A = [3, 2, 1]; +%! assert (polyint(A),polyint(A,0)); +%! assert (polyint(A),polyint(A')); +%! assert (polyint(A),[1, 1, 1, 0]); +%! assert (polyint(A,1),ones(1,4)); + +%!test +%! A = ones(1,8); +%! B = [length(A):-1:1]; +%! assert (polyint(A),[1./B, 0]); + +%!error polyint() +%!error polyint(ones(2,2))