decrease false negatives for str overflow test
This commit is contained in:
parent
ce66f5d918
commit
02b3da1200
1 changed files with 3 additions and 1 deletions
|
@ -602,7 +602,9 @@ mod slice_index {
|
|||
mod rangeinclusive {
|
||||
let DATA = "hello";
|
||||
|
||||
let BAD_INPUT = 1..=usize::max_value();
|
||||
// note: using 0 specifically ensures that the result of overflowing is 0..0,
|
||||
// so that `get` doesn't simply return None for the wrong reason.
|
||||
let BAD_INPUT = 0..=usize::max_value();
|
||||
const EXPECT_MSG = "maximum usize";
|
||||
|
||||
!!generate_tests!!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue