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

Add :gen/return support in malli.generator #933

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

radhikalism
Copy link
Contributor

Resolves #932.

Adds idiom for :gen/return x in properties, just like clojure.test.check.generators/return x. It has similar effect to more indirect workarounds previously like :gen/elements [x] or :gen/gen (gen/return x) or :gen/fmap (constantly x).

Combining :gen/return and :gen/fmap works similarly to combining :gen/return and :gen/elements. Returning nil from :gen/return nil is supported.

@ikitommi ikitommi merged commit 30be01e into metosin:master Aug 16, 2023
10 checks passed
@ikitommi
Copy link
Member

Piilomaan Pikkuaasi 👍

@ikitommi
Copy link
Member

Thanks!

@ikitommi ikitommi mentioned this pull request Aug 31, 2023
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.

Add malli.generator support for :gen/return
2 participants