Also, here's a small additional bit of code to demonstrate what test-exn is
actually checking.

(require rackunit)

;pass
(test-exn "negative coin" exn:fail:contract? (λ _ (sum-coins -1 3 5 7) ))

;fail -- "Wrong exception raised"
(test-exn "negative coin" exn:fail:filesystem? (λ _ (sum-coins -1 3 5 7) ))
 
;fail -- "No exception raised"
(test-exn "negative coin" exn:fail:filesystem? (λ _ (sum-coins +1 3 5 7) ))


____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to