Skip to content

Panic if the max_repeat is lower than the minimum repetition in a pattern #9

Open
@fuchsnj

Description

@fuchsnj

If you create a Generator with a lower max_repeat than the pattern requires, the generator will not error, but you will get a panic when actually generating input.

Example input pattern: x{150,} (repeat x at least 150 times).

panic:

thread <redacted> panicked at 'Uniform::new_inclusive called with `low > high`',<redacted>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand-0.8.5/src/distributions/uniform.rs:567:1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions