[racket] Unit testing of contracts

From: Eduardo Bellani (ebellani at gmail.com)
Date: Mon Jun 20 19:19:24 EDT 2011

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello list.

I have a small set of contracts that I am thinking of turning into a
planet package so I can use them across projects. My problem is, how do
I use the rackunit framework to test them? Here is the first few
contracts that I want to test:

#lang racket

(provide bytes-len/c bytes-len</c bytes-len=/c)

(define (bytes-len/c len fn)
  (flat-contract
   (lambda (expr)
     (and bytes?
        (fn (bytes-length expr) len)))))

(define (bytes-len</c max-length)
  (bytes-len/c max-length <))

(define (bytes-len=/c length)
  (bytes-len/c length =))

Btw, I am also very open to suggestions about those contracts.
Thanks

- -- 
Eduardo Bellani

omnia mutantur, nihil interit.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3/1XwACgkQSbLl0kCTjGk3qgCfUrQuh8z0aoAkK8Kx6Ja4BZYh
V4sAnjMyHZk8C1RYaNn3aZR6WRchBcGj
=UQlT
-----END PGP SIGNATURE-----


Posted on the users mailing list.