mirror of
https://github.com/sharkdp/bat
synced 2024-11-16 21:25:56 +00:00
test: add test for overflow in LineRange::from
This commit is contained in:
parent
9fcc57e496
commit
d89df18de2
@ -128,6 +128,13 @@ fn test_parse_plus() {
|
|||||||
assert_eq!(50, range.upper);
|
assert_eq!(50, range.upper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[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);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_plus_fail() {
|
fn test_parse_plus_fail() {
|
||||||
let range = LineRange::from("40:+z");
|
let range = LineRange::from("40:+z");
|
||||||
|
Loading…
Reference in New Issue
Block a user