From 0937d575fd75044d7b0223e65bbb076097558b25 Mon Sep 17 00:00:00 2001 From: skoriop Date: Thu, 5 Oct 2023 03:50:05 +0530 Subject: [PATCH] fix: rewrite overflow test using `usize::MAX` --- src/line_range.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/line_range.rs b/src/line_range.rs index f47c89fa..8899c706 100644 --- a/src/line_range.rs +++ b/src/line_range.rs @@ -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]