-
-
Notifications
You must be signed in to change notification settings - Fork 103
Improve rackunit support with test-case, test-suite, and check-docs #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Awesome! Did you check if the Monad type works with the rackunit gui as well? |
@rmculpepper Can you have a look at this as well? |
|
||
(define-type test-suite-handler-down | ||
(rackunit-test-suite (Option String) (Thunk Any) (Thunk Any) Seed -> Seed)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these Thunks need to accomodate returning multiple values -- ie, using AnyValues
instead of Any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samth Hmm, that's a good point; probably wouldn't hurt. The rest of the existing code used (Thunk Any)
everywhere, so I didn't think about it, but AnyValues
would probably be better.
@samth It appears it does not work with the GUI runner, but it doesn't look too terribly difficult to resolve. I'll take a look and try to push a fix soon. |
(define current-seed : (Parameter Seed) | ||
(make-parameter #f)) | ||
|
||
(: test-suite-test-case-around (test-suite-handler-here -> ((Thunk Any) -> Any))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would type these as producing Void
.
@samth Updated with your feedback. I didn't include the The |
Merged! |
This fixes issues #6 and #7.
The
test-case
macro was extremely simple to reimplement in typed racket, buttest-suite
is a different beast. This reimplements thetest-suite
macro entirely within typed racket, something that required reimplementing thecurrent-seed
parameter and thetest-suite-test-case-around
andtest-suite-check-around
functions.The precise type of
Seed
is somewhat unclear from the rackunit code, since it appears to be simply threaded through the code, and it can be anything at all, in theory. However, rackunit itself uses a monad type it defines itself in therun-tests
function fromrackunit/text-ui
, so this code assumes seeds will be of that type.