1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-11-25 16:41:00 +00:00

slight changes to tests

This commit is contained in:
Luro02 2020-03-23 12:00:02 +01:00
parent b2fb58559c
commit 02d363daa1
No known key found for this signature in database
GPG key ID: B66FD4F74501A9CF

View file

@ -443,21 +443,21 @@ mod test {
use super::*; use super::*;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
#[test]
fn test_display_and_parse() {
macro_rules! generate_tests { macro_rules! generate_tests {
( $( { $media:expr, $string:expr } ),* $(,)* ) => { ( $( { $struct:expr, $str:expr } ),+ $(,)* ) => {
#[test]
fn test_display() {
$( $(
assert_eq!( assert_eq!($struct.to_string(), $str.to_string());
$media.to_string(), )+
$string.to_string() }
);
assert_eq!( #[test]
$media, fn test_parser() {
$string.parse::<ExtXMedia>().unwrap(), $(
); assert_eq!($struct, $str.parse().unwrap());
)* )+
}
} }
} }
@ -730,7 +730,6 @@ mod test {
ExtXMedia::new(MediaType::Audio, "foo", "bar"), ExtXMedia::new(MediaType::Audio, "foo", "bar"),
"#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"foo\",NAME=\"bar\"" "#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"foo\",NAME=\"bar\""
}, },
};
} }
#[test] #[test]