Skip to content

Commit

Permalink
Fix flaky proptest (Azure#4539)
Browse files Browse the repository at this point in the history
It looks like that in prev version of regex it is possible that `.*` can eval into a digit, which in turn will lead to a valid input :)
```
".*[0-9]{9}.*(k|K|m|M|g|G)?.*"
```
  • Loading branch information
vadim-kovalyov authored Mar 5, 2021
1 parent a526d63 commit d51e139
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mqtt/mqtt-broker/src/settings/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mod tests {
}

#[test]
fn it_cannot_parse_input(input in r".*[0-9]{9}.*(k|K|m|M|g|G)?.*") {
fn it_cannot_parse_input(input in r"[^0-9]+[0-9]{9}[^0-9]+(k|K|m|M|g|G)?.*") {
let size = input.parse::<HumanSize>();
prop_assert!(size.is_err())
}
Expand Down

0 comments on commit d51e139

Please sign in to comment.