diff scripts/miscellaneous/mustBeReal.m @ 27968:c9dd91b438fd

BISTs for new validator functions (Bug #57627).
author Andrew Janke <andrew@apjanke.net>
date Mon, 20 Jan 2020 00:08:43 -0500
parents 3b8d21ff0ca6
children a9a8699a3749
line wrap: on
line diff
--- a/scripts/miscellaneous/mustBeReal.m	Mon Jan 20 21:38:29 2020 +0100
+++ b/scripts/miscellaneous/mustBeReal.m	Mon Jan 20 00:08:43 2020 -0500
@@ -42,3 +42,15 @@
     error ("%s must be real; got a complex value", label);
   endif
 endfunction
+
+%!test
+%! mustBeReal ([])
+%! mustBeReal (42)
+%! mustBeReal (Inf)
+%! mustBeReal (NaN)
+%! mustBeReal (1:100)
+%! mustBeReal (int32(42))
+
+%!error mustBeReal ()
+%!error mustBeReal (i)
+%!error mustBeReal (2 + i)