This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Problems understanding test-suite
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: Problems understanding test-suite
- From: Greg Harvey <Greg dot Harvey at thezone dot net>
- Date: 03 Feb 2000 23:57:56 -0330
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
- References: <Pine.LNX.4.21.0001311807100.868-100000@marvin.ida.ing.tu-bs.de>
Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
> Hi!
>
> In the test-suite I realize the following construct (for example in
> alist.test):
>
> (expect-failure-if (not (defined? 'sloppy-assv-ref))
> (pass-if "alist: assv-ref deformed"
> (catch 'wrong-type-arg
> (lambda ()
> (assv-ref deformed 'sloppy)
> #f)
> (lambda (key . args)
> #t))))
>
> What I don't understand is: Why is the existence of 'sloppy-assv-ref
> important to the outcome of the test? Is 'sloppy-assv-ref supposed to be
> a flag that controls the behaviour of assv-ref? I could not find any
> reference to sloppy-assv-ref in libguile or ice-9.
Actually, it's because the ass*-ref functions work in a `sloppy' way
(you won't get a wrong-type-arg exception, which is the correct
behaviour in this case); the reference to defined? is so that the test
case wouldn't have to be changed if sloppy-assv-ref (which should
behave as the current assv-ref does, with assv-ref doing additional
error checking; like the other sloppy functions) is implemented (I
meant to do it, but just can't find the time for guile stuff lately).
--
Gregh