# HG changeset patch
# User Andrew Janke <andrew@apjanke.net>
# Date 1579496923 18000
#      Mon Jan 20 00:08:43 2020 -0500
# Branch bists-for-validators
# Node ID c4df3ba9a5dbc150a8edd204911c52eb6e8aa805
# Parent  bb214b62839a1fa51474af4159759f0f45feb691
BISTs for new validator functions (Bug #57627).

diff --git a/scripts/miscellaneous/mustBeFinite.m b/scripts/miscellaneous/mustBeFinite.m
--- a/scripts/miscellaneous/mustBeFinite.m
+++ b/scripts/miscellaneous/mustBeFinite.m
@@ -40,8 +40,19 @@ function x = mustBeFinite (x)
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (!tf);
     error ("%s must be finite; got Infs in %d elements: indexes %s", ...
       label, numel (ix_bad), mat2str (ix_bad));
   endif
 endfunction
+
+%!test
+%! mustBeFinite ([]);
+%! mustBeFinite (42);
+%! mustBeFinite (-100:.1:100);
+%! mustBeFinite (int32(42))
+
+%!error mustBeFinite ();
+%!error mustBeFinite (Inf);
+%!error mustBeFinite ([1 2 3 Inf]);
+%!error mustBeFinite ([-Inf -1 0 1]);
diff --git a/scripts/miscellaneous/mustBeGreaterThan.m b/scripts/miscellaneous/mustBeGreaterThan.m
--- a/scripts/miscellaneous/mustBeGreaterThan.m
+++ b/scripts/miscellaneous/mustBeGreaterThan.m
@@ -48,8 +48,16 @@ function x = mustBeGreaterThan (x, c)
         label, c, numel (ix_bad), mat2str (bad));
     catch err
       errmsg = sprintf ("%s must be greater than %f; got %d elements that were not: indexes %s", ...
         label, c, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeGreaterThan (42, 0)
+%! mustBeGreaterThan (Inf, 9999)
+
+%!error mustBeGreaterThan (42, 42)
+%!error mustBeGreaterThan (Inf, Inf)
+%!error mustBeGreaterThan (NaN, 0)
diff --git a/scripts/miscellaneous/mustBeGreaterThanOrEqual.m b/scripts/miscellaneous/mustBeGreaterThanOrEqual.m
--- a/scripts/miscellaneous/mustBeGreaterThanOrEqual.m
+++ b/scripts/miscellaneous/mustBeGreaterThanOrEqual.m
@@ -50,8 +50,18 @@ function x = mustBeGreaterThanOrEqual (x
     catch err
       errmsg = sprintf ( ...
         "%s must be greater than or equal to %f; got %d elements that were not: indexes %s", ...
         label, c, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeGreaterThanOrEqual (42, 0)
+%! mustBeGreaterThanOrEqual (Inf, 9999)
+%! mustBeGreaterThanOrEqual (42, 42)
+%! mustBeGreaterThanOrEqual (Inf, Inf)
+
+%!error mustBeGreaterThanOrEqual ()
+%!error mustBeGreaterThanOrEqual (42)
+%!error mustBeGreaterThanOrEqual (NaN, 0)
diff --git a/scripts/miscellaneous/mustBeInteger.m b/scripts/miscellaneous/mustBeInteger.m
--- a/scripts/miscellaneous/mustBeInteger.m
+++ b/scripts/miscellaneous/mustBeInteger.m
@@ -51,8 +51,20 @@ function x = mustBeInteger (x)
   if ! isempty (but)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be integer-valued; but %s", label, but);
   endif
 endfunction
+
+%!test
+%! mustBeInteger ([])
+%! mustBeInteger (42)
+%! mustBeInteger (1:1000)
+%! mustBeInteger (int32(42))
+
+%!error mustBeInteger ()
+%!error mustBeInteger (1.23)
+%!error mustBeInteger ([1 2 3 4.4])
+%!error mustBeInteger (Inf)
+%!error mustBeInteger (NaN)
diff --git a/scripts/miscellaneous/mustBeLessThan.m b/scripts/miscellaneous/mustBeLessThan.m
--- a/scripts/miscellaneous/mustBeLessThan.m
+++ b/scripts/miscellaneous/mustBeLessThan.m
@@ -50,8 +50,20 @@ function x = mustBeLessThan (x, c)
     catch err
       errmsg = sprintf ( ...
         "%s must be less than %f; got %d elements that were not: indexes %s", ...
         label, c, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeLessThan (0, 1)
+%! mustBeLessThan (-Inf, 42)
+%! mustBeLessThan (42, Inf)
+%! mustBeLessThan (1:41, 42)
+
+%!error mustBeLessThan ()
+%!error mustBeLessThan (1, 0)
+%!error mustBeLessThan (1, 1)
+%!error mustBeLessThan (Inf, Inf)
+%!error mustBeLessThan (1:42, 42)
diff --git a/scripts/miscellaneous/mustBeLessThanOrEqual.m b/scripts/miscellaneous/mustBeLessThanOrEqual.m
--- a/scripts/miscellaneous/mustBeLessThanOrEqual.m
+++ b/scripts/miscellaneous/mustBeLessThanOrEqual.m
@@ -50,8 +50,21 @@ function x = mustBeLessThanOrEqual (x, c
     catch err
       errmsg = sprintf ( ...
         "%s must be less than or equal to %f; got %d elements that were not: indexes %s", ...
         label, c, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+
+%!test
+%! mustBeLessThanOrEqual (0, 1)
+%! mustBeLessThanOrEqual (-Inf, 42)
+%! mustBeLessThanOrEqual (42, Inf)
+%! mustBeLessThanOrEqual (1:41, 42)
+%! mustBeLessThanOrEqual (1:42, 42)
+%! mustBeLessThanOrEqual (1, 1)
+%! mustBeLessThanOrEqual (Inf, Inf)
+
+%!error mustBeLessThanOrEqual ()
+%!error mustBeLessThanOrEqual (1, 0)
diff --git a/scripts/miscellaneous/mustBeMember.m b/scripts/miscellaneous/mustBeMember.m
--- a/scripts/miscellaneous/mustBeMember.m
+++ b/scripts/miscellaneous/mustBeMember.m
@@ -47,8 +47,19 @@ function x = mustBeMember (x, valid)
     n_bad = numel (find (! tf));
     # TODO: Fancy inclusion of bad & valid values in the error message.
     # Probably use mat2str() in a try/catch for that.
     error ( ...
       "%s must be one of the specified valid values; got %d elements that weren't", ...
       label, n_bad);
   endif
 endfunction
+
+%!test
+%! mustBeMember (42, 38:50)
+%! mustBeMember ('foo', {'foo', 'bar', 'baz'})
+%! mustBeMember (38:42, 37:43)
+%! mustBeMember ({'foo','bar'}, {'foo', 'bar', 'baz'})
+
+%!error mustBeMember ()
+%!error mustBeMember (42)
+%!error mustBeMember (42, 1:5)
+%!error mustBeMember ('nope', {'foo', 'bar', 'baz'})
diff --git a/scripts/miscellaneous/mustBeNegative.m b/scripts/miscellaneous/mustBeNegative.m
--- a/scripts/miscellaneous/mustBeNegative.m
+++ b/scripts/miscellaneous/mustBeNegative.m
@@ -50,8 +50,17 @@ function x = mustBeNegative (x)
     catch err
       errmsg = sprintf ( ...
         "%s must be negative; got %d elements that were not: indexes %s", ...
         label, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeNegative (-42)
+%! mustBeNegative ([])
+%! mustBeNegative (-10:-2)
+
+%!error mustBeNegative ()
+%!error mustBeNegative (42)
+%!error mustBeNegative (-5:5)
diff --git a/scripts/miscellaneous/mustBeNonNan.m b/scripts/miscellaneous/mustBeNonNan.m
--- a/scripts/miscellaneous/mustBeNonNan.m
+++ b/scripts/miscellaneous/mustBeNonNan.m
@@ -43,8 +43,19 @@ function x = mustBeNonNan (x)
     endif
     ix_bad = find (! tf);
     errmsg = sprintf ( ...
       "%s must be non-NaN; got %d elements that were not: indexes %s", ...
       label, numel (ix_bad), mat2str (ix_bad));
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeNonNan (42)
+%! mustBeNonNan ('foo')
+%! mustBeNonNan (1:10)
+%! mustBeNonNan (Inf)
+%! mustBeNonNan (-Inf)
+
+%!error mustBeNonNan ()
+%!error mustBeNonNan (NaN)
+%!error mustBeNonNan ([1 2 3 NaN])
diff --git a/scripts/miscellaneous/mustBeNonempty.m b/scripts/miscellaneous/mustBeNonempty.m
--- a/scripts/miscellaneous/mustBeNonempty.m
+++ b/scripts/miscellaneous/mustBeNonempty.m
@@ -37,8 +37,19 @@ function x = mustBeNonempty (x)
   if isempty (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be nonempty; got an empty", label);
   endif
 endfunction
+
+%!test
+%! mustBeNonempty (42)
+%! mustBeNonempty ('Hello')
+%! mustBeNonempty (Inf)
+%! mustBeNonempty (NaN)
+
+%!error mustBeNonempty ()
+%!error mustBeNonempty ([])
+%!error mustBeNonempty ('')
+%!error mustBeNonempty (reshape([], [0 3 3 3]))
diff --git a/scripts/miscellaneous/mustBeNonnegative.m b/scripts/miscellaneous/mustBeNonnegative.m
--- a/scripts/miscellaneous/mustBeNonnegative.m
+++ b/scripts/miscellaneous/mustBeNonnegative.m
@@ -50,8 +50,22 @@ function x = mustBeNonnegative (x)
     catch err
       errmsg = sprintf ( ...
         "%s must be non-negative; got %d elements that were not: indexes %s", ...
         label, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeNonnegative (0)
+%! mustBeNonnegative (1)
+%! mustBeNonnegative (123.456)
+%! mustBeNonnegative (Inf)
+%! mustBeNonnegative (0:10)
+%! mustBeNonnegative (eps)
+
+%!error mustBeNonnegative ()
+%!error mustBeNonnegative (-1)
+%!error mustBeNonnegative ([0 1 2 3 -4])
+%!error mustBeNonnegative (-Inf)
+%!error mustBeNonnegative (NaN)
diff --git a/scripts/miscellaneous/mustBeNonpositive.m b/scripts/miscellaneous/mustBeNonpositive.m
--- a/scripts/miscellaneous/mustBeNonpositive.m
+++ b/scripts/miscellaneous/mustBeNonpositive.m
@@ -50,8 +50,19 @@ function x = mustBeNonpositive (x)
     catch err
       errmsg = sprintf ( ...
         "%s must be non-positive; got %d elements that were not: indexes %s", ...
         label, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeNonpositive (0)
+%! mustBeNonpositive (-1)
+%! mustBeNonpositive (-5:-1)
+%! mustBeNonpositive (-Inf)
+
+%!error mustBeNonpositive ()
+%!error mustBeNonpositive (NaN)
+%!error mustBeNonpositive (1)
+%!error mustBeNonpositive (-10:1)
diff --git a/scripts/miscellaneous/mustBeNonsparse.m b/scripts/miscellaneous/mustBeNonsparse.m
--- a/scripts/miscellaneous/mustBeNonsparse.m
+++ b/scripts/miscellaneous/mustBeNonsparse.m
@@ -37,8 +37,17 @@ function x = mustBeNonsparse (x)
   if issparse (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be nonsparse; got a sparse array", label);
   endif
 endfunction
+
+%!test
+%! mustBeNonsparse ([])
+%! mustBeNonsparse (42)
+%! mustBeNonsparse (1:100)
+%! mustBeNonsparse (Inf)
+
+%!error mustBeNonsparse (sparse(42))
+%!error mustBeNonsparse ()
diff --git a/scripts/miscellaneous/mustBeNonzero.m b/scripts/miscellaneous/mustBeNonzero.m
--- a/scripts/miscellaneous/mustBeNonzero.m
+++ b/scripts/miscellaneous/mustBeNonzero.m
@@ -28,23 +28,40 @@
 ##
 ## Requires that input @var{x} is not zero.
 ##
 ## Raises an error if any element of the input @var{x} is zero, as determined
 ## by @code{@var{x} != 0}.
 ##
 ## @end deftypefn
 
+# TODO: Should NaN be considered nonzero? It fits the formal definition above,
+# but that may not be the spirit of the test. And it's not equal to any non-zero
+# value.
+
 function x = mustBeNonzero (x)
   tf = x != 0;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
     errmsg = sprintf ( ...
       "%s must be non-zero; got %d elements that were zero: indexes %s", ...
       label, numel (ix_bad), mat2str (ix_bad));
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBeNonzero (1)
+%! mustBeNonzero (-1)
+%! mustBeNonzero ([-5:-1 1:5])
+%! mustBeNonzero (Inf)
+%! mustBeNonzero (-Inf)
+%! mustBeNonzero (NaN)
+%! mustBeNonzero (eps)
+
+%!error mustBeNonzero ()
+%!error mustBeNonzero (0)
+%!error mustBeNonzero (-10:10)
diff --git a/scripts/miscellaneous/mustBeNumeric.m b/scripts/miscellaneous/mustBeNumeric.m
--- a/scripts/miscellaneous/mustBeNumeric.m
+++ b/scripts/miscellaneous/mustBeNumeric.m
@@ -37,8 +37,20 @@ function x = mustBeNumeric (x)
   if ! isnumeric (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be numeric; got a %s", label, class (x));
   endif
 endfunction
+
+%!test
+%! mustBeNumeric ([])
+%! mustBeNumeric (42)
+%! mustBeNumeric (int32(42))
+%! mustBeNumeric (NaN)
+
+%!error mustBeNumeric ()
+%!error mustBeNumeric ('foo')
+%!error mustBeNumeric (struct)
+%!error mustBeNumeric ({})
+%!error mustBeNumeric (true)
diff --git a/scripts/miscellaneous/mustBeNumericOrLogical.m b/scripts/miscellaneous/mustBeNumericOrLogical.m
--- a/scripts/miscellaneous/mustBeNumericOrLogical.m
+++ b/scripts/miscellaneous/mustBeNumericOrLogical.m
@@ -37,8 +37,20 @@ function x = mustBeNumericOrLogical (x)
   if ! (isnumeric (x) || islogical (x))
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be numeric or logical; got a %s", label, class (x));
   endif
 endfunction
+
+%!test
+%! mustBeNumericOrLogical ([])
+%! mustBeNumericOrLogical (true)
+%! mustBeNumericOrLogical (false)
+%! mustBeNumericOrLogical (42)
+%! mustBeNumericOrLogical (int32(42))
+
+%!error mustBeNumericOrLogical ()
+%!error mustBeNumericOrLogical ('foo')
+%!error mustBeNumericOrLogical ({})
+%!error mustBeNumericOrLogical (struct)
diff --git a/scripts/miscellaneous/mustBePositive.m b/scripts/miscellaneous/mustBePositive.m
--- a/scripts/miscellaneous/mustBePositive.m
+++ b/scripts/miscellaneous/mustBePositive.m
@@ -50,8 +50,22 @@ function x = mustBePositive (x)
     catch err
       errmsg = sprintf ( ...
         "%s must be positive; got %d elements that were not: indexes %s", ...
         label, numel (ix_bad), mat2str (ix_bad));
     end_try_catch
     error (errmsg);
   endif
 endfunction
+
+%!test
+%! mustBePositive (1)
+%! mustBePositive (123.456)
+%! mustBePositive (Inf)
+%! mustBePositive (eps)
+
+%!error mustBePositive ()
+%!error mustBePositive (0)
+%!error mustBePositive (0:10)
+%!error mustBePositive (-1)
+%!error mustBePositive ([0 1 2 3 -4])
+%!error mustBePositive (-Inf)
+%!error mustBePositive (NaN)
diff --git a/scripts/miscellaneous/mustBeReal.m b/scripts/miscellaneous/mustBeReal.m
--- a/scripts/miscellaneous/mustBeReal.m
+++ b/scripts/miscellaneous/mustBeReal.m
@@ -37,8 +37,20 @@ function x = mustBeReal (x)
   if ! isreal (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     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)
# HG changeset patch
# User Andrew Janke <andrew@apjanke.net>
# Date 1579497201 18000
#      Mon Jan 20 00:13:21 2020 -0500
# Branch bists-for-validators
# Node ID 49fb9289173ccf149adfe265f7964c27cb109ca8
# Parent  c4df3ba9a5dbc150a8edd204911c52eb6e8aa805
Remove argouts from new validator functions (Bug #57627).

The argouts are a non-Matlab-compatible extension that got pulled over from Validoozy by mistake.

diff --git a/scripts/miscellaneous/mustBeFinite.m b/scripts/miscellaneous/mustBeFinite.m
--- a/scripts/miscellaneous/mustBeFinite.m
+++ b/scripts/miscellaneous/mustBeFinite.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeFinite (@var{x})
+## @deftypefn {} mustBeFinite (@var{x})
 ##
 ## Requires that input @var{x} is finite.
 ##
 ## Raises an error if any element of the input @var{x} is not finite, as
 ## determined by @code{isfinite (x)}.
 ##
 ## @end deftypefn
 
-function x = mustBeFinite (x)
+function mustBeFinite (x)
   tf = isfinite (x);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (!tf);
     error ("%s must be finite; got Infs in %d elements: indexes %s", ...
diff --git a/scripts/miscellaneous/mustBeGreaterThan.m b/scripts/miscellaneous/mustBeGreaterThan.m
--- a/scripts/miscellaneous/mustBeGreaterThan.m
+++ b/scripts/miscellaneous/mustBeGreaterThan.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeGreaterThan (@var{x}, @var{c})
+## @deftypefn {} mustBeGreaterThan (@var{x}, @var{c})
 ##
 ## Requires that input @var{x} is greater than @var{c}.
 ##
 ## Raises an error if any element of the input @var{x} is not greater than
 ## @var{c}, as determined by @code{@var{x} > @var{c}}.
 ##
 ## @end deftypefn
 
-function x = mustBeGreaterThan (x, c)
+function mustBeGreaterThan (x, c)
   tf = x > c;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeGreaterThanOrEqual.m b/scripts/miscellaneous/mustBeGreaterThanOrEqual.m
--- a/scripts/miscellaneous/mustBeGreaterThanOrEqual.m
+++ b/scripts/miscellaneous/mustBeGreaterThanOrEqual.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeGreaterThanOrEqual (@var{x}, @var{c})
+## @deftypefn {} mustBeGreaterThanOrEqual (@var{x}, @var{c})
 ##
 ## Requires that input @var{x} is greater than or equal to @var{c}.
 ##
 ## Raises an error if any element of the input @var{x} is not greater than
 ## or equal to @var{c}, as determined by @code{@var{x} >= @var{c}}.
 ##
 ## @end deftypefn
 
-function x = mustBeGreaterThanOrEqual (x, c)
+function mustBeGreaterThanOrEqual (x, c)
   tf = x >= c;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeInteger.m b/scripts/miscellaneous/mustBeInteger.m
--- a/scripts/miscellaneous/mustBeInteger.m
+++ b/scripts/miscellaneous/mustBeInteger.m
@@ -19,27 +19,27 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeInteger (@var{x})
+## @deftypefn {} mustBeInteger (@var{x})
 ##
 ## Requires that input @var{x} is integer-valued (but not necessarily
 ## integer-typed).
 ##
 ## Raises an error if any element of the input @var{x} is not a finite,
 ## real, integer-valued numeric value, as determined by various checks.
 ##
 ## @end deftypefn
 
-function x = mustBeInteger (x)
+function mustBeInteger (x)
   if isinteger (x) || islogical (x)
     return
   endif
   but = [];
   if ! isnumeric (x)
     but = sprintf ("it was non-numeric (got a %s)", class (x));
   elseif any (! isfinite (x))
     but = "there were Inf values";
diff --git a/scripts/miscellaneous/mustBeLessThan.m b/scripts/miscellaneous/mustBeLessThan.m
--- a/scripts/miscellaneous/mustBeLessThan.m
+++ b/scripts/miscellaneous/mustBeLessThan.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeLessThan (@var{x}, @var{c})
+## @deftypefn {} mustBeLessThan (@var{x}, @var{c})
 ##
 ## Requires that input @var{x} is less than @var{c}.
 ##
 ## Raises an error if any element of the input @var{x} is not less than
 ## @var{c}, as determined by @code{@var{x} < @var{c}}.
 ##
 ## @end deftypefn
 
-function x = mustBeLessThan (x, c)
+function mustBeLessThan (x, c)
   tf = x < c;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeLessThanOrEqual.m b/scripts/miscellaneous/mustBeLessThanOrEqual.m
--- a/scripts/miscellaneous/mustBeLessThanOrEqual.m
+++ b/scripts/miscellaneous/mustBeLessThanOrEqual.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeLessThanOrEqual (@var{x}, @var{c})
+## @deftypefn {} mustBeLessThanOrEqual (@var{x}, @var{c})
 ##
 ## Requires that input is less than or equal to a given value.
 ##
 ## Raises an error if any element of the input @var{x} is not less than
 ## or equal to @var{c}, as determined by @code{@var{x} <= @var{c}}.
 ##
 ## @end deftypefn
 
-function x = mustBeLessThanOrEqual (x, c)
+function mustBeLessThanOrEqual (x, c)
   tf = x <= c;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeMember.m b/scripts/miscellaneous/mustBeMember.m
--- a/scripts/miscellaneous/mustBeMember.m
+++ b/scripts/miscellaneous/mustBeMember.m
@@ -19,30 +19,30 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeMember (@var{x}, @var{valid})
+## @deftypefn {} mustBeMember (@var{x}, @var{valid})
 ##
 ## Requires that input @var{x} is a member of a set of given valid values.
 ##
 ## Raises an error if any element of the input @var{x} is not a member
 ## of @var{valid}, as determined by @code{ismember (@var{x})}.
 ##
 ## Note that char inputs may behave weirdly, because of the interaction
 ## between chars and cellstrings when calling ismember() on them.  But it
 ## will probably "do what you mean" if you just use it naturally.
 ##
 ## @end deftypefn
 
-function x = mustBeMember (x, valid)
+function mustBeMember (x, valid)
   tf = ismember (x, valid);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     n_bad = numel (find (! tf));
     # TODO: Fancy inclusion of bad & valid values in the error message.
diff --git a/scripts/miscellaneous/mustBeNegative.m b/scripts/miscellaneous/mustBeNegative.m
--- a/scripts/miscellaneous/mustBeNegative.m
+++ b/scripts/miscellaneous/mustBeNegative.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNegative (@var{x})
+## @deftypefn {} mustBeNegative (@var{x})
 ##
 ## Requires that input @var{x} is negative.
 ##
 ## Raises an error if any element of the input @var{x} is not negative, as
 ## determined by @code{@var{x} < 0}.
 ##
 ## @end deftypefn
 
-function x = mustBeNegative (x)
+function mustBeNegative (x)
   tf = x < 0;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeNonNan.m b/scripts/miscellaneous/mustBeNonNan.m
--- a/scripts/miscellaneous/mustBeNonNan.m
+++ b/scripts/miscellaneous/mustBeNonNan.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNonNan (@var{x})
+## @deftypefn {} mustBeNonNan (@var{x})
 ##
 ## Requires that input @var{x} is non-NaN.
 ##
 ## Raises an error if any element of the input @var{x} is NaN, as determined
 ## by @code{isnan (@var{x})}.
 ##
 ## @end deftypefn
 
-function x = mustBeNonNan (x)
+function mustBeNonNan (x)
   tf = ! isnan (x);
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeNonempty.m b/scripts/miscellaneous/mustBeNonempty.m
--- a/scripts/miscellaneous/mustBeNonempty.m
+++ b/scripts/miscellaneous/mustBeNonempty.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNonempty (@var{x})
+## @deftypefn {} mustBeNonempty (@var{x})
 ##
 ## Requires that input @var{x} is nonempty.
 ##
 ## Raises an error if the input @var{x} is not empty, as determined by
 ## @code{! isempty (@var{x})}.
 ##
 ## @end deftypefn
 
-function x = mustBeNonempty (x)
+function mustBeNonempty (x)
   if isempty (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be nonempty; got an empty", label);
   endif
 endfunction
diff --git a/scripts/miscellaneous/mustBeNonnegative.m b/scripts/miscellaneous/mustBeNonnegative.m
--- a/scripts/miscellaneous/mustBeNonnegative.m
+++ b/scripts/miscellaneous/mustBeNonnegative.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNonnegative (@var{x})
+## @deftypefn {} mustBeNonnegative (@var{x})
 ##
 ## Requires that input @var{x} is not negative.
 ##
 ## Raises an error if any element of the input @var{x} is negative, as
 ## determined by @code{@var{x} >= 0}.
 ##
 ## @end deftypefn
 
-function x = mustBeNonnegative (x)
+function mustBeNonnegative (x)
   tf = x >= 0;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeNonpositive.m b/scripts/miscellaneous/mustBeNonpositive.m
--- a/scripts/miscellaneous/mustBeNonpositive.m
+++ b/scripts/miscellaneous/mustBeNonpositive.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNonpositive (@var{x})
+## @deftypefn {} mustBeNonpositive (@var{x})
 ##
 ## Requires that input @var{x} is not positive.
 ##
 ## Raises an error if any element of the input @var{x} is positive, as
 ## determined by @code{@var{x} <= 0}.
 ##
 ## @end deftypefn
 
-function x = mustBeNonpositive (x)
+function mustBeNonpositive (x)
   tf = x <= 0;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeNonsparse.m b/scripts/miscellaneous/mustBeNonsparse.m
--- a/scripts/miscellaneous/mustBeNonsparse.m
+++ b/scripts/miscellaneous/mustBeNonsparse.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNonsparse (@var{x})
+## @deftypefn {} mustBeNonsparse (@var{x})
 ##
 ## Requires that input @var{x} is not sparse.
 ##
 ## Raises an error if the input @var{x} is sparse, as determined by
 ## @code{issparse (@var{x})}.
 ##
 ## @end deftypefn
 
-function x = mustBeNonsparse (x)
+function mustBeNonsparse (x)
   if issparse (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be nonsparse; got a sparse array", label);
   endif
 endfunction
diff --git a/scripts/miscellaneous/mustBeNonzero.m b/scripts/miscellaneous/mustBeNonzero.m
--- a/scripts/miscellaneous/mustBeNonzero.m
+++ b/scripts/miscellaneous/mustBeNonzero.m
@@ -19,30 +19,30 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNonzero (@var{x})
+## @deftypefn {} {mustBeNonzero (@var{x})
 ##
 ## Requires that input @var{x} is not zero.
 ##
 ## Raises an error if any element of the input @var{x} is zero, as determined
 ## by @code{@var{x} != 0}.
 ##
 ## @end deftypefn
 
 # TODO: Should NaN be considered nonzero? It fits the formal definition above,
 # but that may not be the spirit of the test. And it's not equal to any non-zero
 # value.
 
-function x = mustBeNonzero (x)
+function mustBeNonzero (x)
   tf = x != 0;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeNumeric.m b/scripts/miscellaneous/mustBeNumeric.m
--- a/scripts/miscellaneous/mustBeNumeric.m
+++ b/scripts/miscellaneous/mustBeNumeric.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNumeric (@var{x})
+## @deftypefn {} mustBeNumeric (@var{x})
 ##
 ## Requires that input @var{x} is numeric.
 ##
 ## Raises an error if the input @var{x} is not numeric, as determined by
 ## @code{isnumeric (@var{x})}.
 ##
 ## @end deftypefn
 
-function x = mustBeNumeric (x)
+function mustBeNumeric (x)
   if ! isnumeric (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be numeric; got a %s", label, class (x));
   endif
 endfunction
diff --git a/scripts/miscellaneous/mustBeNumericOrLogical.m b/scripts/miscellaneous/mustBeNumericOrLogical.m
--- a/scripts/miscellaneous/mustBeNumericOrLogical.m
+++ b/scripts/miscellaneous/mustBeNumericOrLogical.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeNumericOrLogical (@var{x})
+## @deftypefn {} mustBeNumericOrLogical (@var{x})
 ##
 ## Requires that input @var{x} is numeric or logical.
 ##
 ## Raises an error if the input @var{x} is not numeric or logical, as
 ## determined by @code{isnumeric (@var{x}) || islogical (@var{x})}.
 ##
 ## @end deftypefn
 
-function x = mustBeNumericOrLogical (x)
+function mustBeNumericOrLogical (x)
   if ! (isnumeric (x) || islogical (x))
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be numeric or logical; got a %s", label, class (x));
   endif
 endfunction
diff --git a/scripts/miscellaneous/mustBePositive.m b/scripts/miscellaneous/mustBePositive.m
--- a/scripts/miscellaneous/mustBePositive.m
+++ b/scripts/miscellaneous/mustBePositive.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBePositive (@var{x})
+## @deftypefn {} mustBePositive (@var{x})
 ##
 ## Requires that input @var{x} is positive.
 ##
 ## Raises an error if any element of the input @var{x} is not positive, as
 ## determined by @code{@var{x} > 0}.
 ##
 ## @end deftypefn
 
-function x = mustBePositive (x)
+function mustBePositive (x)
   tf = x > 0;
   tf = tf(:);
   if ! all (tf)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     ix_bad = find (! tf);
diff --git a/scripts/miscellaneous/mustBeReal.m b/scripts/miscellaneous/mustBeReal.m
--- a/scripts/miscellaneous/mustBeReal.m
+++ b/scripts/miscellaneous/mustBeReal.m
@@ -19,26 +19,26 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <https://www.gnu.org/licenses/>.
 ##
 ########################################################################
 
 ## -*- texinfo -*-
-## @deftypefn {} {@var{x} =} mustBeReal (@var{x})
+## @deftypefn {} mustBeReal (@var{x})
 ##
 ## Requires that input @var{x} is real.
 ##
 ## Raises an error if the input @var{x} is not real, as determined by
 ## @code{isreal (@var{x})}.
 ##
 ## @end deftypefn
 
-function x = mustBeReal (x)
+function mustBeReal (x)
   if ! isreal (x)
     label = inputname (1);
     if isempty (label)
       label = "input";
     endif
     error ("%s must be real; got a complex value", label);
   endif
 endfunction
