-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Extended Syntax: primops tests #107
Conversation
-- TODO: Once merged, use "../../prim_ops.c" | ||
C.include "../../prim_ops.h" | ||
|
||
spec :: Spec |
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.
With a little more effort you could write property based tests for these primitive functions as well.
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.
There are some, see below:
it "works for a random string" $ monadicIO $ do
str <- pick randomString
run $ primStringLen str
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.
Well at least we check if we don't do segfault :D .
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.
The next thing would be looking into how a set of primops and their composition do satisfy some kind of commutative diagrams, but that is a bit overkill atm.
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.
Good point about the property-based tests. For now, let's just merge this, and address it separately.
See #32