Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Write arbitrary instance for data that uses sized #178

Merged
merged 3 commits into from
Dec 13, 2021

Conversation

Yasuke
Copy link
Contributor

@Yasuke Yasuke commented Dec 8, 2021

By using sized we can have an arbitrary instance that actually
terminates and is configurable via standard QuickCheck
methods (e.g. generate, resize). This will allow testing with Datums and
will prevent users unintentionally stalling their tests when generating
Datums, BuiltinData, and Data. Fixes #172.

@silky
Copy link
Contributor

silky commented Dec 8, 2021

@Yasuke Looks good; I think it would also make sense to have a few tests that confirm this is working how you'd expect?

By using sized we can have an arbitrary instance that actually
terminates and is configurable via standard QuickCheck
methods (e.g. generate, resize). This will allow testing with Datums and
will prevent users unintentionally stalling their tests when generating
Datums, BuiltinData, and Data. Fixes IntersectMBO#172.
@Yasuke Yasuke force-pushed the so/bounded-arbitrary-data branch from 1395654 to a1a5717 Compare December 10, 2021 04:07
@Yasuke
Copy link
Contributor Author

Yasuke commented Dec 10, 2021

Test-suite added and comments addressed.

@Yasuke Yasuke force-pushed the so/bounded-arbitrary-data branch from e3ebd65 to 1ea9082 Compare December 10, 2021 04:23
Copy link
Contributor

@silky silky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! :) Thanks @Yasuke

@sjoerdvisscher sjoerdvisscher merged commit f1a7702 into IntersectMBO:main Dec 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arbitrary Datum produces infinitely* large data structures
5 participants