[racket-dev] Racktest was: OMG the thread that will never die about testing

From: Noel Welsh (noelwelsh at gmail.com)
Date: Sun Feb 20 12:37:48 EST 2011

Here's a proposal that attempts to synthesise prior discussion. It
support the features I want without imposing overhead on Eli.

;; Base Types

(define-type (Dict Key Value)
  (U (HashTable Key Value) (Listof (Pair Key Value))))

(define-type Name (Listof Symbol))
(define-type Info (Dict Symbol Any))

;; Test Results

(struct: Test-Info ([name : Name] [info : Info] [result: Test-Result]))

(define-type Test-Result (U success failure))

(struct: Success ())
;; Skipped and Pending are a subtype of Success -- report it if you support it
(struct: Skipped Success ())
(struct: Pending Success ())

(struct: Failure ([exn : (U exn #f)]))
;; An error is a failure that occurred outside a testing construct --
report it if you support it
(struct: Error Failure ())

N.


Posted on the dev mailing list.