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.
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
verl/test/prop_verl.erl
Line 22 in 36ec5f3
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.