From c0db47b717026a07e8b9e332d887ed70f0bc64d0 Mon Sep 17 00:00:00 2001 From: Luro02 <24826124+Luro02@users.noreply.github.com> Date: Sat, 28 Sep 2019 14:33:44 +0200 Subject: [PATCH] even more codecov --- .travis.yml | 6 ++--- src/tags/master_playlist/media.rs | 45 +++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3f0a73..e06554b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ cache: cargo before_cache: | if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then cargo install cargo-tarpaulin + cargo install cargo-update + cargo install-update --all fi before_cache: @@ -25,10 +27,6 @@ script: - cargo test after_success: | - if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then - which cargo-install-update || cargo install cargo-update - cargo install-update --all - fi # this does require a -Z flag for Doctests, which is unstable! if [[ "$TRAVIS_RUST_VERSION" == nightly ]]; then cargo tarpaulin --out Xml --run-types Tests Doctests diff --git a/src/tags/master_playlist/media.rs b/src/tags/master_playlist/media.rs index b44003e..dd5f585 100644 --- a/src/tags/master_playlist/media.rs +++ b/src/tags/master_playlist/media.rs @@ -955,6 +955,28 @@ mod test { FORCED=YES,\ CHARACTERISTICS=\"public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound\"".to_string() ); + + assert_eq!( + ExtXMedia::builder() + .media_type(MediaType::ClosedCaptions) + .group_id("cc") + .language("sp") + .name("CC2") + .instream_id(InStreamId::Cc2) + .is_autoselect(true) + .build() + .unwrap() + .to_string(), + "#EXT-X-MEDIA:\ + TYPE=CLOSED-CAPTIONS,\ + GROUP-ID=\"cc\",\ + LANGUAGE=\"sp\",\ + NAME=\"CC2\",\ + AUTOSELECT=YES,\ + INSTREAM-ID=\"CC2\"" + .to_string() + ); + // ---- assert_eq!( ExtXMedia::new(MediaType::Audio, "foo", "bar").to_string(), @@ -1166,7 +1188,6 @@ mod test { .unwrap() ); - // TODO add below to test_parser assert_eq!( ExtXMedia::builder() .media_type(MediaType::Audio) @@ -1213,7 +1234,27 @@ mod test { FORCED=NO,\ CHARACTERISTICS=\"public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound\"".parse().unwrap() ); - // + + assert_eq!( + ExtXMedia::builder() + .media_type(MediaType::ClosedCaptions) + .group_id("cc") + .language("sp") + .name("CC2") + .instream_id(InStreamId::Cc2) + .is_autoselect(true) + .build() + .unwrap(), + "#EXT-X-MEDIA:\ + TYPE=CLOSED-CAPTIONS,\ + GROUP-ID=\"cc\",\ + LANGUAGE=\"sp\",\ + NAME=\"CC2\",\ + AUTOSELECT=YES,\ + INSTREAM-ID=\"CC2\"" + .parse() + .unwrap() + ); // ---- assert_eq!(