[imp-hackers] ansi test issues

Sam Steingold sds at gnu.org
Thu Jul 9 14:02:47 UTC 2009


On Thu, Jul 9, 2009 at 3:40 AM, Juan Jose
Garcia-Ripoll<juanjose.garciaripoll at googlemail.com> wrote:
> On Thu, Jul 9, 2009 at 2:05 AM, Sam Steingold<sds at gnu.org> wrote:
>> 2. the test infrastructure assumes that there is only one possible
>> correct return value, while sometimes the standard admits multiple
>> interpretations.
>> How should we handle this?
>> one option is to allow multiple variants, e.g.,
>> (deftest foo
>>  (form)
>>  (possible-return-value-1 possible-return-value-2))
>
> The other possibility is to include that in the test itself, like
> (deftest foo
>  (and (member (form) '(possible-return-value-1 ...) :test #'equalp) t)
>  t)

indeed.
do people prefer this?

> I agree though, that it looks ugly, but it would also handle the loops
> in which the same test is repeated with multiple outputs and only one
> possible output value is assumed.

certainly, and my proposal is not applicable to such loops.

> However, before adding different return values, wouldn't the changes
> need to be discussed?

of course any functional change should be discussed and documented!

E.g., consider print-level.[89]
the text and examples in
 http://www.lispworks.com/documentation/HyperSpec/Body/v_pr_lev.htm
seem to indicated that
(write-to-string #S(foo) :print-level 0)
should return "#" and not "#S(foo)" as the tests mandate.

In fact, I argue that this is a case where the test is _wrong_ as
opposed to two possible return values being both acceptable.

-- 
Sam Steingold <http://sds.podval.org>




More information about the implementation-hackers mailing list