[racket] tests/eli-tester feedback

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Feb 14 17:53:38 EST 2011

Two minutes ago, Robby Findler wrote:
> I guess I'm asking if true is bound somewhere or not.

Ah -- I should have remembered that point.  Yes, I meant that it is
bound.  I should have also said that `true' is a bad name for this
reason, in the same way that `->' is (I'd prefer it over `=>').  BTW,
this leads to another requirement -- the "namespace pollution" should
be minimal since you don't want code to change (as in `true' getting
some strange value for tests) because you use tests.

In any case, if this is a sane approach, then maybe it can be used for
the multiple values and the exceptions case too.  Something like this:

  (test E1 => true-result
        E2 => (values-result 1 2)
        E3 => (raised-result 666))

?

On one hand, it bugs me exactly because of the above -- it adds a
bunch of `*-result' bindings, but this is similar to adding new
arrows.  On the other hand, it might be a convenient way to provide
extensibility in an easier way -- something like:

  (test E => (matching-result (list x x)))

would check that E evaluates to a list of two equal things using
`match'.  I'd be even more tempted if it could also be used instead of
some arrows, like

  (test E1 => (error-result "expected error text")
        E2 => (output-result "expected output text"))

This might work, but it means that the RHS should be evaluated first
to see how the LHS is evaluated -- catching errors in the first case,
and capturing output in the second.

Does this sound like a good idea?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.