Mercurial > hg > octave-terminal
changeset 12885:39ee18712709
maint: periodic merge of stable to default
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Tue, 26 Jul 2011 02:18:55 -0500 |
parents | 6e2971841d67 (current diff) 73e75ff9c31b (diff) |
children | a539714f3291 |
files | |
diffstat | 2 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1500,7 +1500,7 @@ Array<idx_vector> idx (dim_vector (a.ndims (), 1)); idx(0) = i; idx(1) = j; - for (int k = 0; k < a.ndims (); k++) + for (int k = 2; k < a.ndims (); k++) idx(k) = idx_vector (0, a.dimensions(k)); assign (idx, a); }
--- a/scripts/testfun/assert.m +++ b/scripts/testfun/assert.m @@ -125,9 +125,8 @@ error (); endif if (empty) - v = cell (1, 0); - endif - if (normal) + v = {}; + elseif (normal) v = {v}; else v = v(:)'; @@ -307,13 +306,19 @@ %!error assert (x,y) %!error assert (3, x); %!error assert (x, 3); - -## check usage statements -%!error assert -%!error assert(1,2,3,4,5) +%!test +%! # Empty structures +%! x = resize (x, 0, 1); +%! y = resize (y, 0, 1); +%! assert (x, y); ## strings %!assert("dog","dog") %!error assert("dog","cat") %!error assert("dog",3); %!error assert(3,"dog"); + +## check input validation +%!error assert +%!error assert (1,2,3,4,5) +