[racket] tests/eli-tester feedback (Was: Racket unit testing)

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Feb 15 09:35:15 EST 2011

5 minutes ago, David Van Horn wrote:
> On 2/15/11 7:02 AM, Eli Barzilay wrote:
> > Three hours ago, Hendrik Boom wrote:
> >> On Mon, Feb 14, 2011 at 04:43:24PM -0600, Robby Findler wrote:
> >>> I guess I'm asking if true is bound somewhere or not.
> >>
> >> It almost looks as if you want predicates on the right side of =>'
> >
> > Yes -- the whole point of the simple arrow-less version is to make
> > using predicates very easy.  For example, instead of some
> >
> > 1. (test E1 =satisfies>  even?
> >           E2 =satisfies>  (lambda (x) (>  x 50)))
> >
> > you'd write
> >
> > 2. (test (even? E1)
> >           (>  E2 50))
> 
> You could allow the arrow-less form (which I like) but require it to 
> produce #t and only #t.  This accommodates your examples while catching 
> things like:
> 
>     (test (fact 5) 121)

Nice idea -- and for the rare cases where you want a non-boolean
predicate you'd resort to the less conveniet

  (test (and (member E '(1 2 3)) #t))

Robby: would you find this acceptable, or is the hole that it leaves
(making the no-arrow mistake with a #t-resulting expression) too big?

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


Posted on the users mailing list.