racket / rackunit

Other
18 stars 34 forks source link

report arity errors in terms of the public API #100

Closed bennn closed 6 years ago

bennn commented 6 years ago

Fix for #99

Now this program:

#lang racket

(require rackunit)
(check-exn (lambda () 'hi))

Errors with:

check-exn: arity mismatch;
 the expected number of arguments does not match the given number
  given: 1
  arguments...:
   #<procedure:...rackunit/foo.rkt:4:11>
  context...:
   "/..../rackunit/foo.rkt": [running body]
   for-loop
   run-module-instance!125
   perform-require!78

This still needs a regression test. (EDIT: added a test)

But also, I'm not happy adding an extra lambda to get the keyword arguments. Suggestions welcome.

AlexKnauth commented 6 years ago

Does this fix #103 as well?

bennn commented 6 years ago

yes this fixes #103

bennn commented 6 years ago

I'm planning to merge this tomorrow night

AlexKnauth commented 6 years ago

To me, this looks good now.

bennn commented 6 years ago

wow, great timing!