Skip to content

pre inputs in property tests may be too wide #14

@starbelly

Description

@starbelly

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions