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

Enhancement: fault generation for instacheck generators #2

Open
norton-at-kpmg opened this issue Feb 16, 2020 · 0 comments
Open

Enhancement: fault generation for instacheck generators #2

norton-at-kpmg opened this issue Feb 16, 2020 · 0 comments

Comments

@norton-at-kpmg
Copy link

First of all - thank you for the great library. It is really helpful and easy to use.

I haven't yet looked in the implementation but I would like to ask about the possibility for an enhancement. I would like to automagically generate faulty test samples that would fail if parsed by a given EBNF grammar.

I understand this could be a general feature of test.check, test.chuck, clojure.alpha.spec.gen, etc. but I'm specifically focused on instacheck at this time.

Is this something that you have considered? Would this be of interest to others?

Thank you.

p.s. This feature is supported by Erlang's eqc QuickCheck.

http://quviq.com/documentation/eqc/index.html

fault/2

fault(Fault::gen(A), G::gen(A)) -> gen(A)

Adds a fault - generation alternative to a generator. The probability of using the faulty alternative is controlled by fault_rate/3, more_faulty/2, and less_faulty/2. If no fault rate is specified, then the faulty alternative is never used. Shrinking attempts to replace a faulty value by a freshly generated non - faulty one.

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

1 participant