# HG changeset patch # User Andriy Shinkarchuck # Date 1310857957 18000 # Node ID 4e9576618df87de0a8336120299ddd32ae0411de # Parent 7869cc61ce90be88714243f8ac402c9a52961f90 codesprint: Wrote 2 tests for polyint.m diff --git a/scripts/polynomial/polyint.m b/scripts/polynomial/polyint.m --- a/scripts/polynomial/polyint.m +++ b/scripts/polynomial/polyint.m @@ -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))