From 39407c6551c22921155bc73a230b51ca6036c29d Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Sat, 10 Aug 2024 10:31:53 -0700 Subject: [PATCH] async cleanup --- src/app/index/browser.rs | 20 ++++++++++---------- src/app/index/collection.rs | 32 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/app/index/browser.rs b/src/app/index/browser.rs index 9d86214..92c83cc 100644 --- a/src/app/index/browser.rs +++ b/src/app/index/browser.rs @@ -205,8 +205,8 @@ mod test { (browser, strings) } - #[tokio::test] - async fn can_browse_top_level() { + #[test] + fn can_browse_top_level() { let song_a = PathBuf::from_iter(["Music", "Iron Maiden", "Moonchild.mp3"]); let (browser, strings) = setup_test(HashSet::from([song_a])); let files = browser.browse(&strings, PathBuf::new()).unwrap(); @@ -214,8 +214,8 @@ mod test { assert_eq!(files[0], File::Directory(PathBuf::from_iter(["Music"]))); } - #[tokio::test] - async fn can_browse_directory() { + #[test] + fn can_browse_directory() { let artist_directory = PathBuf::from_iter(["Music", "Iron Maiden"]); let (browser, strings) = setup_test(HashSet::from([ @@ -234,8 +234,8 @@ mod test { ); } - #[tokio::test] - async fn can_flatten_root() { + #[test] + fn can_flatten_root() { let song_a = PathBuf::from_iter(["Music", "Electronic", "Papua New Guinea.mp3"]); let song_b = PathBuf::from_iter(["Music", "Metal", "Destiny.mp3"]); let song_c = PathBuf::from_iter(["Music", "Metal", "No Turning Back.mp3"]); @@ -251,8 +251,8 @@ mod test { assert_eq!(files, [song_a, song_b, song_c]); } - #[tokio::test] - async fn can_flatten_directory() { + #[test] + fn can_flatten_directory() { let electronic = PathBuf::from_iter(["Music", "Electronic"]); let song_a = electronic.join(PathBuf::from_iter(["FSOL", "Papua New Guinea.mp3"])); let song_b = electronic.join(PathBuf::from_iter(["Kraftwerk", "Autobahn.mp3"])); @@ -269,8 +269,8 @@ mod test { assert_eq!(files, [song_a, song_b]); } - #[tokio::test] - async fn can_flatten_directory_with_shared_prefix() { + #[test] + fn can_flatten_directory_with_shared_prefix() { let directory_a = PathBuf::from_iter(["Music", "Therion", "Leviathan II"]); let directory_b = PathBuf::from_iter(["Music", "Therion", "Leviathan III"]); let song_a = directory_a.join("Pazuzu.mp3"); diff --git a/src/app/index/collection.rs b/src/app/index/collection.rs index bf5cee3..6324278 100644 --- a/src/app/index/collection.rs +++ b/src/app/index/collection.rs @@ -303,8 +303,8 @@ mod test { (browser, strings) } - #[tokio::test] - async fn can_list_artists() { + #[test] + fn can_list_artists() { let (collection, strings) = setup_test(Vec::from([ scanner::Song { virtual_path: PathBuf::from("Kai.mp3"), @@ -329,8 +329,8 @@ mod test { assert_eq!(artists, vec!["FSOL".to_owned(), "Stratovarius".to_owned()]); } - #[tokio::test] - async fn artist_list_is_sorted() { + #[test] + fn artist_list_is_sorted() { let (collection, strings) = setup_test(Vec::from([ scanner::Song { virtual_path: PathBuf::from("Destiny.mp3"), @@ -358,8 +358,8 @@ mod test { ); } - #[tokio::test] - async fn can_get_random_albums() { + #[test] + fn can_get_random_albums() { let (collection, strings) = setup_test(Vec::from([ scanner::Song { album: Some("ISDN".to_owned()), @@ -383,8 +383,8 @@ mod test { ); } - #[tokio::test] - async fn can_get_recent_albums() { + #[test] + fn can_get_recent_albums() { let (collection, strings) = setup_test(Vec::from([ scanner::Song { album: Some("ISDN".to_owned()), @@ -410,8 +410,8 @@ mod test { ); } - #[tokio::test] - async fn albums_are_associated_with_artists() { + #[test] + fn albums_are_associated_with_artists() { let artist_name = "Bestest Artist"; let other_artist_name = "Cool Kidz"; let album_name = "Bestest Album"; @@ -517,8 +517,8 @@ mod test { } } - #[tokio::test] - async fn albums_are_sorted_by_year() { + #[test] + fn albums_are_sorted_by_year() { let (collection, strings) = setup_test(Vec::from([ scanner::Song { virtual_path: PathBuf::from("Rebel.mp3"), @@ -570,8 +570,8 @@ mod test { ); } - #[tokio::test] - async fn album_songs_are_sorted() { + #[test] + fn album_songs_are_sorted() { let album_path = PathBuf::from_iter(["FSOL", "Lifeforms"]); let (collection, strings) = setup_test(Vec::from([ scanner::Song { @@ -634,8 +634,8 @@ mod test { ); } - #[tokio::test] - async fn can_get_a_song() { + #[test] + fn can_get_a_song() { let song_path = PathBuf::from_iter(["FSOL", "ISDN", "Kai.mp3"]); let (collection, strings) = setup_test(Vec::from([scanner::Song { virtual_path: song_path.clone(),