Fix failed test on CLRF

This commit is contained in:
Rutger Schoorstra
2020-03-06 20:59:15 +01:00
parent ab9c554eb4
commit 100a57078a
2 changed files with 23 additions and 8 deletions

View File

@ -199,13 +199,29 @@ fn quotes() {
Result::Ok(("rest".as_bytes(), "value".to_string()))
);
}
#[test]
fn consume_line_empty() {
assert_eq!(
consume_line(b"\r\nrest"),
Result::Err(nom::Err::Error(("\r\nrest".as_bytes(), nom::error::ErrorKind::IsNot)))
);
}
#[test]
fn consume_empty_line() {
let line = consume_line(b"\r\nrest");
println!("{:?}", line);
fn consume_line_n() {
assert_eq!(
consume_line(b"before\nrest"),
Result::Ok(("rest".as_bytes(), "before".into()))
);
}
#[test]
fn consume_line_rn() {
assert_eq!(
consume_line(b"before\r\nrest"),
Result::Ok(("rest".as_bytes(), "before".into()))
);
}
#[test]