octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fail.m ?


From: Paul Kienzle
Subject: Re: fail.m ?
Date: Wed, 15 Mar 2006 19:52:14 -0500


On Mar 15, 2006, at 5:21 PM, John W. Eaton wrote:

On 15-Mar-2006, David Bateman wrote:

| Any reason that fail.m was removed from scripts/testfun?

A message from Paul Kienzle said that it was no longer needed.  I sent
a note to you and Paul about this yesterday, in a message with the
subject "regexp and tests":

  | 1. 'fail' has been superceded by 'error' and 'warning' blocks.
  | No need to include it.

  OK, I removed it.

| Its removal
| causes about 20 odd test to fail with "make check". In many cases you
| can replace these failing tests with "%!error" but I have found that
| some cases require
|
| %!test
| %! ...
| %! fail(...)
|
| and so it would be better to keep it in my opinion...

OK, if you think it should come back from the dead, I can arrange
that.

There are two things I don't like about fail: it duplicates
code it test.m and like eval it involves too much quoting.

Also I wasn't expecting it would be needed in at %!test
block since failure conditions should be fairly easy to
set up.  It isn't present in octave-forge.

That said, if David feels the need for it, then by all
means resurrect it.

I think the interface should be changed so that it matches
the format of error/warning blocks.

For example:

  %!error <pattern> code
  %!warning <pattern> code

should be equivalent to:

  %!test fail('error','<pattern>','code')
  %!test fail('warning','<pattern>','code')

The current definition is:

   fail(code)
   fail(code,'pattern')
   fail(code,'warning','pattern')

I suggest:

   fail(code)
   fail('<pattern>',code)
   fail('warning'|'error','<pattern>',code)

I'm not sure if the <> should be required for the patterns
in the fail function, but if it is not there then it is
harder to convert between error/warning and test blocks.

The octave-forge version of test still defines

   %!fail (...)

as equivalent to

   %!test fail(...)

Comments?

- Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]