mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-28 08:28:37 +01:00
Line range edge cases test
This commit is contained in:
parent
715b0d8bf5
commit
b8e79a2160
@ -145,6 +145,19 @@ fn test_parse_minus_success() {
|
|||||||
assert_eq!(40, range.upper);
|
assert_eq!(40, range.upper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_parse_minus_edge_cases_success() {
|
||||||
|
let range = LineRange::from("5:-4").expect("Shouldn't fail on test!");
|
||||||
|
assert_eq!(1, range.lower);
|
||||||
|
assert_eq!(5, range.upper);
|
||||||
|
let range = LineRange::from("5:-5").expect("Shouldn't fail on test!");
|
||||||
|
assert_eq!(0, range.lower);
|
||||||
|
assert_eq!(5, range.upper);
|
||||||
|
let range = LineRange::from("5:-100").expect("Shouldn't fail on test!");
|
||||||
|
assert_eq!(0, range.lower);
|
||||||
|
assert_eq!(5, range.upper);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_minus_fail() {
|
fn test_parse_minus_fail() {
|
||||||
let range = LineRange::from("40:-z");
|
let range = LineRange::from("40:-z");
|
||||||
|
Loading…
Reference in New Issue
Block a user