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

pre inputs in property tests may be too wide #14

Open
starbelly opened this issue Apr 3, 2021 · 0 comments
Open

pre inputs in property tests may be too wide #14

starbelly opened this issue Apr 3, 2021 · 0 comments

Comments

@starbelly
Copy link
Collaborator

starbelly commented Apr 3, 2021

We're doing a lot of defensive checks in some of our main property tests which suggests the inputs may be too wide. Specifically, in the basic semver 0 test we have to check via regex whether an input is to be considered valid or invalid. Given the wide array of invalid and valid inputs this is probably an anti-pattern as far as property testing goes.

See

case {re:run(Pre, "^[0-9A-Za-z-+]+$"), re:run(Pre, "(^0[0-9]+)|(^[+]$)|[\r\n]")} of

The name of the test is also a misnomer. If it's too check for both valid and invalid cases it should be renamed.

Edit:

Note this is specifically around the pre part of the input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant