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

Cannot generate values for regular expression schema #1038

Open
lasiltan opened this issue Apr 12, 2024 · 2 comments
Open

Cannot generate values for regular expression schema #1038

lasiltan opened this issue Apr 12, 2024 · 2 comments

Comments

@lasiltan
Copy link

Trying to generate values for a regular expression schema results in an error using malli version 0.15.0:

(mg/generate [:re #"^[0-9]$"])
Execution error (ExceptionInfo) at malli.core/-exception (core.cljc:136).
:test-chuck-not-available

Generating other values works

(mg/generate keyword?)
=> :hL/-Fy

(mg/generate [:enum "a" "b" "c"])
=> "a"
@lasiltan
Copy link
Author

I see from the code itself as well as the README that you need to have com.gfredericks/test.chuck as dependency to enable regex generation.

Perhaps the error message could state this instead of just saying :test-chuck-not-available

@frenchy64
Copy link
Contributor

FWIW this regal schema might also be useful, I'm not sure how a regal generator and test.chuck generator compare though: lambdaisland/regal#48

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

No branches or pull requests

2 participants