# HG changeset patch # User John W. Eaton # Date 1596488858 14400 # Node ID af361aea02e09ea5f846945cd2093b062c99ccd6 # Parent 83172e1c77f2d6f938cfc0883628f3c3114a00b9 allow tests to work when disable_range is true * ov-typeinfo.cc, diag-perm.tst, mk-conv-tst.sh: Fix tests to pass when disable_range is true. diff -r 83172e1c77f2 -r af361aea02e0 libinterp/octave-value/ov-typeinfo.cc --- a/libinterp/octave-value/ov-typeinfo.cc Tue Aug 11 15:20:01 2020 -0400 +++ b/libinterp/octave-value/ov-typeinfo.cc Mon Aug 03 17:07:38 2020 -0400 @@ -942,7 +942,12 @@ %!assert (typeinfo ([i, 2]), "complex matrix") %!assert (typeinfo (diag ([i, 2])), "complex diagonal matrix") -%!assert (typeinfo (1:2), "range") +%!test +%! if (disable_range ()) +%! assert (typeinfo (1:2), "matrix") +%! else +%! assert (typeinfo (1:2), "range") +%! endif %!assert (typeinfo (false), "bool") %!assert (typeinfo ([true, false]), "bool matrix") diff -r 83172e1c77f2 -r af361aea02e0 test/diag-perm.tst --- a/test/diag-perm.tst Tue Aug 11 15:20:01 2020 -0400 +++ b/test/diag-perm.tst Mon Aug 03 17:07:38 2020 -0400 @@ -178,6 +178,8 @@ %! assert (diag (D1D2), d1 .* d2); ## slicing +## preserving diagonal matrix type is not possible if indices are +## general matrix objects. %!test %! m = 13; %! n = 6; @@ -185,7 +187,11 @@ %! d = rand (mn, 1); %! D = diag (d, m, n); %! Dslice = D (1:(m-3), 1:(n-2)); -%! assert (typeinfo (Dslice), "diagonal matrix"); +%! if (disable_range ()) +%! assert (typeinfo (Dslice), "matrix"); +%! else +%! assert (typeinfo (Dslice), "diagonal matrix"); +%! endif ## preserve dense matrix structure when scaling %!assert (typeinfo (rand (8) * (3 * eye (8))), "matrix") diff -r 83172e1c77f2 -r af361aea02e0 test/mk-conv-tst.sh --- a/test/mk-conv-tst.sh Tue Aug 11 15:20:01 2020 -0400 +++ b/test/mk-conv-tst.sh Mon Aug 03 17:07:38 2020 -0400 @@ -28,7 +28,7 @@ cat <