This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problems understanding test-suite


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]