Mercurial > octave-antonio
comparison scripts/testfun/assert.m @ 20162:2645f9ef8c88 stable
doc: Update more docstrings to have one sentence summary as first line.
Reviewed specfun, special-matrix, testfun, and time script directories.
* scripts/specfun/expint.m, scripts/specfun/isprime.m,
scripts/specfun/legendre.m, scripts/specfun/primes.m,
scripts/specfun/reallog.m, scripts/specfun/realsqrt.m,
scripts/special-matrix/gallery.m, scripts/special-matrix/hadamard.m,
scripts/special-matrix/hankel.m, scripts/special-matrix/hilb.m,
scripts/special-matrix/invhilb.m, scripts/special-matrix/magic.m,
scripts/special-matrix/pascal.m, scripts/special-matrix/rosser.m,
scripts/special-matrix/toeplitz.m, scripts/special-matrix/vander.m,
scripts/special-matrix/wilkinson.m, scripts/testfun/assert.m,
scripts/testfun/demo.m, scripts/testfun/example.m, scripts/testfun/fail.m,
scripts/testfun/rundemos.m, scripts/testfun/runtests.m,
scripts/testfun/speed.m, scripts/time/asctime.m, scripts/time/calendar.m,
scripts/time/clock.m, scripts/time/ctime.m, scripts/time/datenum.m,
scripts/time/datestr.m, scripts/time/datevec.m, scripts/time/etime.m,
scripts/time/is_leap_year.m, scripts/time/now.m, scripts/time/weekday.m:
Update more docstrings to have one sentence summary as first line.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 03 May 2015 17:00:11 -0700 |
parents | cbba639b956b |
children |
comparison
equal
deleted
inserted
replaced
20160:03b9d17a2d95 | 20162:2645f9ef8c88 |
---|---|
31 ## @table @code | 31 ## @table @code |
32 ## @item assert (@var{cond}) | 32 ## @item assert (@var{cond}) |
33 ## @itemx assert (@var{cond}, @var{errmsg}) | 33 ## @itemx assert (@var{cond}, @var{errmsg}) |
34 ## @itemx assert (@var{cond}, @var{errmsg}, @dots{}) | 34 ## @itemx assert (@var{cond}, @var{errmsg}, @dots{}) |
35 ## @itemx assert (@var{cond}, @var{msg_id}, @var{errmsg}, @dots{}) | 35 ## @itemx assert (@var{cond}, @var{msg_id}, @var{errmsg}, @dots{}) |
36 ## Called with a single argument @var{cond}, @code{assert} produces an | 36 ## Called with a single argument @var{cond}, @code{assert} produces an error if |
37 ## error if @var{cond} is false (numeric zero). Any additional arguments are | 37 ## @var{cond} is false (numeric zero). |
38 ## passed to the @code{error} function for processing. | 38 ## |
39 ## Any additional arguments are passed to the @code{error} function for | |
40 ## processing. | |
39 ## | 41 ## |
40 ## @item assert (@var{observed}, @var{expected}) | 42 ## @item assert (@var{observed}, @var{expected}) |
41 ## Produce an error if observed is not the same as expected. Note that | 43 ## Produce an error if observed is not the same as expected. |
42 ## @var{observed} and @var{expected} can be scalars, vectors, matrices, | 44 ## |
43 ## strings, cell arrays, or structures. | 45 ## Note that @var{observed} and @var{expected} can be scalars, vectors, |
46 ## matrices, strings, cell arrays, or structures. | |
44 ## | 47 ## |
45 ## @item assert (@var{observed}, @var{expected}, @var{tol}) | 48 ## @item assert (@var{observed}, @var{expected}, @var{tol}) |
46 ## Produce an error if observed is not the same as expected but equality | 49 ## Produce an error if observed is not the same as expected but equality |
47 ## comparison for numeric data uses a tolerance @var{tol}. | 50 ## comparison for numeric data uses a tolerance @var{tol}. |
51 ## | |
48 ## If @var{tol} is positive then it is an absolute tolerance which will produce | 52 ## If @var{tol} is positive then it is an absolute tolerance which will produce |
49 ## an error if @code{abs (@var{observed} - @var{expected}) > abs (@var{tol})}. | 53 ## an error if @code{abs (@var{observed} - @var{expected}) > abs (@var{tol})}. |
54 ## | |
50 ## If @var{tol} is negative then it is a relative tolerance which will produce | 55 ## If @var{tol} is negative then it is a relative tolerance which will produce |
51 ## an error if @code{abs (@var{observed} - @var{expected}) > | 56 ## an error if @code{abs (@var{observed} - @var{expected}) > |
52 ## abs (@var{tol} * @var{expected})}. | 57 ## abs (@var{tol} * @var{expected})}. |
58 ## | |
53 ## If @var{expected} is zero @var{tol} will always be interpreted as an | 59 ## If @var{expected} is zero @var{tol} will always be interpreted as an |
54 ## absolute tolerance. If @var{tol} is not scalar its dimensions must agree | 60 ## absolute tolerance. |
55 ## with those of @var{observed} and @var{expected} and tests are performed on | 61 ## |
56 ## an element-by-element basis. | 62 ## If @var{tol} is not scalar its dimensions must agree with those of |
63 ## @var{observed} and @var{expected} and tests are performed on an | |
64 ## element-by-element basis. | |
57 ## @end table | 65 ## @end table |
58 ## @seealso{fail, test, error, isequal} | 66 ## @seealso{fail, test, error, isequal} |
59 ## @end deftypefn | 67 ## @end deftypefn |
60 | 68 |
61 function assert (cond, varargin) | 69 function assert (cond, varargin) |