Mercurial > hg > octave-lyh
diff scripts/testfun/fail.m @ 16190:7fe4ea72ba4d stable
doc: Update 'test' and "fail" documentation
With thanks to Iain Cunningham <iain.cunningham@eese.co.uk>
* testfun.txi: Add more examples on how to use fail, assert, error,
and xtest.
* fail.m: Explain more the kind of input that fail needs and how it
behaves.
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Mon, 04 Mar 2013 16:47:22 -0500 |
parents | 72c96de7a403 |
children | 70c47da7e02b |
line wrap: on
line diff
--- a/scripts/testfun/fail.m +++ b/scripts/testfun/fail.m @@ -29,10 +29,19 @@ ## is a string and if @var{code} runs successfully, the error produced is: ## ## @example -## expected error but got none +## expected error <.> but got none ## @end example ## -## If the code fails with a different error, the message produced is: +## +## Code must be in the form of a string that may be passed by +## @code{fail} to the Octave interpreter via the @code{evalin} function, +## that is, a (quoted) string constant or a string variable. +## +## If called with two arguments, the behavior is similar to +## @code{fail (@var{code})}, except the return value will only be true if +## code fails with an error message containing pattern (case sensitive). +## If the code fails with a different error to that given in pattern, +## the message produced is: ## ## @example ## @group