Skip to content

Commit

Permalink
fix: rewrite overflow test using usize::MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
skoriop authored and sharkdp committed Oct 5, 2023
1 parent 4382be5 commit 0937d57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/line_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ fn test_parse_plus() {

#[test]
fn test_parse_plus_overflow() {
let range = LineRange::from("18446744073709551615:+1").expect("Shouldn't fail on test!");
assert_eq!(18446744073709551615, range.lower);
assert_eq!(18446744073709551615, range.upper);
let range = LineRange::from(&format!("{}:+1", usize::MAX)).expect("Shouldn't fail on test!");
assert_eq!(usize::MAX, range.lower);
assert_eq!(usize::MAX, range.upper);
}

#[test]
Expand Down

0 comments on commit 0937d57

Please sign in to comment.