From 89a3904385d2555d9ca9ce5cb176c682954a16f9 Mon Sep 17 00:00:00 2001 From: Luro02 <24826124+Luro02@users.noreply.github.com> Date: Sat, 28 Sep 2019 13:56:55 +0200 Subject: [PATCH] more codecov --- .travis.yml | 7 +++-- src/tags/master_playlist/media.rs | 49 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10db05e..18e48ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,10 +26,13 @@ script: after_success: | if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then + which cargo-install-update || cargo install cargo-update + cargo install-update --all + # Uncomment the following line for coveralls.io - cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID --run-types Tests Doctests + # cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID # Uncomment the following two lines create and upload a report for codecov.io - cargo tarpaulin --out Xml + cargo tarpaulin --out Xml --run-types Tests Doctests bash <(curl -s https://codecov.io/bash) fi diff --git a/src/tags/master_playlist/media.rs b/src/tags/master_playlist/media.rs index 03d45ea..8de0727 100644 --- a/src/tags/master_playlist/media.rs +++ b/src/tags/master_playlist/media.rs @@ -1116,6 +1116,55 @@ mod test { .parse() .unwrap() ); + + assert_eq!( + ExtXMedia::builder() + .media_type(MediaType::Audio) + .group_id("audio-aacl-312") + .language("en") + .name("English") + .is_autoselect(true) + .is_default(true) + .channels("2") + .build() + .unwrap(), + "#EXT-X-MEDIA:\ + TYPE=AUDIO,\ + GROUP-ID=\"audio-aacl-312\",\ + LANGUAGE=\"en\",\ + NAME=\"English\",\ + DEFAULT=YES,\ + AUTOSELECT=YES,\ + CHANNELS=\"2\"" + .parse() + .unwrap() + ); + + assert_eq!( + ExtXMedia::builder() + .media_type(MediaType::Subtitles) + .uri("french/ed.ttml") + .group_id("subs") + .language("fra") + .assoc_language("fra") + .name("French") + .is_autoselect(true) + .characteristics("public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound") + .build() + .unwrap(), + "#EXT-X-MEDIA:\ + URI=\"french/ed.ttml\",\ + TYPE=SUBTITLES,\ + GROUP-ID=\"subs\",\ + LANGUAGE=\"fra\",\ + ASSOC-LANGUAGE=\"fra\",\ + NAME=\"French\",\ + AUTOSELECT=YES,\ + FORCED=NO,\ + CHARACTERISTICS=\"public.accessibility.transcribes-spoken-dialog,public.accessibility.describes-music-and-sound\"".parse().unwrap() + ); + // + // ---- assert_eq!( ExtXMedia::new(MediaType::Audio, "foo", "bar"),