From baffdf885aab7490e1024a73f8ee3ce35817c586 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 14 Oct 2024 20:59:32 +0200 Subject: test(treewide): Fix, so they compile and ignore The tests are just not in an ideal state right now. Running them via `cargo test` still works, but the `yt_dlp` test simply seem to deadlock? --- crates/yt_dlp/src/duration.rs | 4 ++-- crates/yt_dlp/src/tests.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/yt_dlp/src') diff --git a/crates/yt_dlp/src/duration.rs b/crates/yt_dlp/src/duration.rs index f91892d..19181a5 100644 --- a/crates/yt_dlp/src/duration.rs +++ b/crates/yt_dlp/src/duration.rs @@ -68,11 +68,11 @@ mod test { #[test] fn test_display_duration_1h() { let dur = Duration { time: 60 * 60 }; - assert_eq!("[1h 0m]".to_owned(), dur.to_string()); + assert_eq!("1h 0m".to_owned(), dur.to_string()); } #[test] fn test_display_duration_30min() { let dur = Duration { time: 60 * 30 }; - assert_eq!("[30m 0s]".to_owned(), dur.to_string()); + assert_eq!("30m 0s".to_owned(), dur.to_string()); } } diff --git a/crates/yt_dlp/src/tests.rs b/crates/yt_dlp/src/tests.rs index 08e392f..b48deb4 100644 --- a/crates/yt_dlp/src/tests.rs +++ b/crates/yt_dlp/src/tests.rs @@ -34,10 +34,10 @@ async fn test_extract_info_video() { false, ) .await - .map_err(|err| format!("Encountered error: '{}'", err)) + .map_err(|err| format!("Encountered error: '{err}'")) .unwrap(); - println!("{:#?}", info); + println!("{info:#?}"); } #[tokio::test] @@ -49,10 +49,10 @@ async fn test_extract_info_url() { false, ) .await - .map_err(|err| format!("Encountered error: '{}'", err)) + .map_err(|err| format!("Encountered error: '{err}'")) .unwrap(); - println!("{:#?}", err); + println!("{err:#?}"); } #[tokio::test] @@ -64,10 +64,10 @@ async fn test_extract_info_playlist() { true, ) .await - .map_err(|err| format!("Encountered error: '{}'", err)) + .map_err(|err| format!("Encountered error: '{err}'")) .unwrap(); - println!("{:#?}", err); + println!("{err:#?}"); } #[tokio::test] async fn test_extract_info_playlist_full() { @@ -78,8 +78,8 @@ async fn test_extract_info_playlist_full() { true, ) .await - .map_err(|err| format!("Encountered error: '{}'", err)) + .map_err(|err| format!("Encountered error: '{err}'")) .unwrap(); - println!("{:#?}", err); + println!("{err:#?}"); } -- cgit 1.4.1