Mercurial > hg > octave-avbm
changeset 7028:ecd6347f7d1c
[project @ 2007-10-15 09:00:02 by dbateman]
author | dbateman |
---|---|
date | Mon, 15 Oct 2007 09:00:02 +0000 |
parents | 3e2a59c78b9d |
children | f583eda0e93f |
files | scripts/ChangeLog scripts/testfun/test.m |
diffstat | 2 files changed, 17 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-10-15 David Bateman <dbateman@free.fr> + + * testfun/test.m: In error/warning blocks test for an error before + a warning to avoid unexpected failures. + 2007-10-15 Kim Hansen i<kimhanse@gmail.com> * testfun/assert.m: Correct documentation of absolution versus
--- a/scripts/testfun/test.m +++ b/scripts/testfun/test.m @@ -381,21 +381,22 @@ warning ("on", "quiet"); try eval (sprintf ("__test__(%s);", __shared)); - __err = trimerr (lastwarn, "warning"); - warning (__warnstate.state, "quiet"); - if (! __warning) __msg = sprintf ("%sexpected <%s> but got no error\n", __signal_fail, __pattern); - elseif (isempty (__err)) - __msg = sprintf ("%sexpected <%s> but got no warning\n", + else + __err = trimerr (lastwarn, "warning"); + warning (__warnstate.state, "quiet"); + if (isempty (__err)) + __msg = sprintf ("%sexpected <%s> but got no warning\n", __signal_fail, __pattern); - elseif (isempty (regexp (__err, __pattern, "once"))) - __msg = sprintf ("%sexpected <%s> but got %s\n", - __signal_fail, __pattern, __err); - else - __success = 1; - endif + elseif (isempty (regexp (__err, __pattern, "once"))) + __msg = sprintf ("%sexpected <%s> but got %s\n", + __signal_fail, __pattern, __err); + else + __success = 1; + endif + endif catch __err = trimerr (lasterr, "error");