Skip to content
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

Merged
merged 3 commits into from
Jun 9, 2020
Merged

Conversation

Anabra
Copy link
Member

@Anabra Anabra commented May 10, 2020

See #32

@Anabra Anabra added the review Ready for review label May 10, 2020
@Anabra Anabra requested review from csabahruska and andorp May 10, 2020 17:28
@Anabra Anabra self-assigned this May 10, 2020
-- TODO: Once merged, use "../../prim_ops.c"
C.include "../../prim_ops.h"

spec :: Spec
Copy link
Contributor

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.

Copy link
Member

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

Copy link
Member

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 .

Copy link
Member

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.

Copy link
Member Author

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.

@Anabra Anabra merged commit 7d48fca into 32-extended-syntax Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants