Mercurial > hg > octave-terminal
changeset 8975:2e9af3363669
fix tests with ones
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 13 Mar 2009 16:47:50 +0100 |
parents | fde2a916b2ac |
children | 22a7e4690742 |
files | scripts/specfun/legendre.m test/test_diag_perm.m test/test_slice.m |
diffstat | 3 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/specfun/legendre.m +++ b/scripts/specfun/legendre.m @@ -234,4 +234,4 @@ %!test %! result = legendre (0, 0:0.1:1); -%! assert (result, ones(1,11)) +%! assert (result, full(ones(1,11)))
--- a/test/test_diag_perm.m +++ b/test/test_diag_perm.m @@ -46,8 +46,8 @@ %! n = 4; %! P1 = eye (n) (:, randperm (n)); %! A = zeros (n) + P1; -%! assert (sum (A), ones (1, n)); -%! assert (sum (A, 2), ones (n, 1)); +%! assert (sum (A), full (ones (1, n))); +%! assert (sum (A, 2), full (ones (n, 1))); ## preserve dense matrix structure %!test
--- a/test/test_slice.m +++ b/test/test_slice.m @@ -118,30 +118,30 @@ %!assert(set_slice([2 1], 33, 3), reshape([1 1 0 0 2 2],[2 1 3])); ## size = [1 2] -%!assert(set_slice([1 2], 11, []), ones([1 2])); +%!assert(set_slice([1 2], 11, []), full(ones([1 2]))); %!assert(set_slice([1 2], 11, 1), [2 1]); %!assert(set_slice([1 2], 11, 2), [1 2]); %!assert(set_slice([1 2], 11, 3), [1 1 2]); %!assert(set_slice([1 2], 11, 4), [1 1 0 2]); -%!assert(set_slice([1 2], 21, []), ones([1 2])); +%!assert(set_slice([1 2], 21, []), full(ones([1 2]))); %!assert(set_slice([1 2], 21, 1), [2 2]); %!assert(set_slice([1 2], 21, 2), [1 1;2 2]); %!assert(set_slice([1 2], 21, 3), [1 1;0 0;2 2]); -%!assert(set_slice([1 2], 22, []), ones([1 2])); +%!assert(set_slice([1 2], 22, []), full(ones([1 2]))); %!assert(set_slice([1 2], 22, 1), [2 1]); %!assert(set_slice([1 2], 22, 2), [1 2]); %!assert(set_slice([1 2], 22, 3), [1 1 2]); %!assert(set_slice([1 2], 22, 4), [1 1 0 2]); -%!assert(set_slice([1 2], 31, []), ones([1 2])); +%!assert(set_slice([1 2], 31, []), full(ones([1 2]))); %!assert(set_slice([1 2], 31, 1), [2 2]); %!assert(set_slice([1 2], 31, 2), [1 1;2 2]); %!assert(set_slice([1 2], 31, 3), [1 1;0 0;2 2]); -%!assert(set_slice([1 2], 32, []), ones([1 2])); +%!assert(set_slice([1 2], 32, []), full(ones([1 2]))); %!assert(set_slice([1 2], 32, 1), [2 1]); %!assert(set_slice([1 2], 32, 2), [1 2]); %!assert(set_slice([1 2], 32, 3), [1 1 2]); %!assert(set_slice([1 2], 32, 4), [1 1 0 2]); -%!assert(set_slice([1 2], 33, []), ones([1 2])); +%!assert(set_slice([1 2], 33, []), full(ones([1 2]))); %!assert(set_slice([1 2], 33, 1), [2 2]); %!assert(set_slice([1 2], 33, 2), reshape([1 1 2 2],[1 2 2])); %!assert(set_slice([1 2], 33, 3), reshape([1 1 0 0 2 2],[1 2 3]));