[racket] Tests before of to define the function

From: Juan Francisco Cantero Hurtado (iam at juanfra.info)
Date: Wed Jul 10 17:17:17 EDT 2013

On 07/10/13 23:00, Matthias Felleisen wrote:
> #lang racket
>
> (module+ test ;; I like to specify dependencies for test submodules in a test submodule:
>   (require rackunit))
>
> ;; N -> N
> ;; double the given number
>
> (module+ test
>   (check-equal? (double 2) 4)
>   (check-equal? (double 2) 3))
>
> (define (double n)
>   (* n 2))

Thanks a lot! :D


Posted on the users mailing list.