changeset 24343:1b17a5d82e3f

eigs.m: Fix failing BIST test (bug #49523). * eigs.m: Use isreal() to determine whether NaN or NaN+1i*NaN should be the expected value.
author Rik <rik@octave.org>
date Fri, 01 Dec 2017 11:08:26 -0800
parents 30bbef7bf919
children cac0f8a1c696
files scripts/sparse/eigs.m
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/sparse/eigs.m	Thu Nov 30 09:01:11 2017 +0100
+++ b/scripts/sparse/eigs.m	Fri Dec 01 11:08:26 2017 -0800
@@ -1387,8 +1387,11 @@
 %! opts.maxit = 1;
 %! warning ("off", "Octave:eigs:UnconvergedEigenvalues", "local");
 %! d = eigs (A, 4, "sm", opts);
-%! assert (d(4), NaN);
-%! assert (imag (d(4)), 0);
+%! if (isreal (d))
+%!   assert (d(4), NaN);
+%! else
+%!   assert (d(4), NaN +1i*NaN);
+%! endif
 %!testif HAVE_ARPACK
 %! A = magic (100) / 10 + eye (100);
 %! opts.v0 = (1:100)';