William Harold Newman wrote:
> On Wed, May 09, 2001 at 10:25:57PM +0200, Martin Atzmueller wrote:
> > I have attached an "example test file", too.
> > I'm not sure, if this can be turned into a regression test:
> > it is not that straightforward to ASSERT error-messages ...
> The Mai patch was also supposed to catch at least one class of errors
> which had gone undetected before. It's reasonably straightforward to
> test for that:
> # This should fail, but didn't until sbcl-0.6.12.7, with Martin
> # Atzmueller's port of Pierre Mai's fixes.
> cat > $tmpfilename <<EOF
> (in-package :cl-user)
> ;; This definition has too many qualifiers, so loading the
> ;; DEFMETHOD should fail.
> (defmethod zut progn :around ((x integer)) (print "integer"))
> expect_load_error $tmpfilename
> (See Fowler, _Refactoring_, chapter 4 if you want a more complete
> explanation of the approach that I'm trying to use here.)
Yes, thanks for the explanation. I'll probably reread that chapter soon.
However the code only tests for an error, not for the
"invalid-method-error", and I think this simply can't be tested that
easily. But the error case should be enough, anyway.
So, testing for simple errors that turn up at load/compile time, it
should also suffice to do it like in
(not (ignore-errors <form that should cause an error,non-NIL>)))
I'll implement that approach in a patch that is to come.
Martin Atzmueller <martin@...>