Two issues:

1: wrap the function-under-test in a thunk

2. check for exception type, here exn:fail:contract? which is raised by
raise-argument-error.  the more general exn:fail? would also work.


(require rackunit)

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

 

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

Reply via email to