mirror of
https://github.com/v0l/m3u8-rs.git
synced 2025-06-21 18:55:24 +00:00
Fix consume_line
not returning line when line doesn't end with a newline
This commit is contained in:
12
tests/lib.rs
12
tests/lib.rs
@ -86,6 +86,11 @@ fn playlist_not_ending_in_newline_master() {
|
||||
assert!(print_parse_playlist_test("master-not-ending-in-newline.m3u8"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn playlist_not_ending_in_newline_master1() {
|
||||
assert!(print_parse_playlist_test("master-not-ending-in-newline-1.m3u8"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn playlist_not_ending_in_newline_media() {
|
||||
assert!(print_parse_playlist_test("media-not-ending-in-newline.m3u8"));
|
||||
@ -201,10 +206,9 @@ fn quotes() {
|
||||
|
||||
#[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)))
|
||||
);
|
||||
let expected = Result::Ok(("rest".as_bytes(), "".to_string()));
|
||||
let actual = consume_line(b"\r\nrest");
|
||||
assert_eq!(expected, actual);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Reference in New Issue
Block a user