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

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.

plutus-pab/src/Plutus/PAB/Arbitrary.hs Show resolved Hide resolved
plutus-pab/src/Plutus/PAB/Arbitrary.hs Outdated Show resolved Hide resolved
@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
Copy link
Contributor Author

Yasuke commented Dec 10, 2021

Test-suite added and comments addressed.

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 join this conversation on GitHub. Already have an account? Sign in to comment
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