From 8fad7701af3606ff270e3bca60dc4745a208a79f Mon Sep 17 00:00:00 2001 From: Polochon-street Date: Mon, 24 Oct 2022 10:07:19 +0200 Subject: [PATCH] Add a "no tags" test for the library module --- src/library.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/library.rs b/src/library.rs index c30bb74..e1c99a6 100644 --- a/src/library.rs +++ b/src/library.rs @@ -2150,6 +2150,17 @@ mod test { } } + #[test] + fn test_no_tags() { + let (mut library, _temp_dir, _) = setup_test_library(); + library.config.base_config_mut().features_version = 0; + + let paths = vec!["./data/no_tags.flac"]; + library.analyze_paths(paths.to_owned(), false).unwrap(); + let song = library.song_from_path::<()>("./data/no_tags.flac").unwrap(); + assert_eq!(None, song.bliss_song.title); + } + #[test] fn test_analyze_paths() { let (mut library, _temp_dir, _) = setup_test_library(); @@ -2168,7 +2179,7 @@ mod test { _library_song_from_database(connection, path) }) .collect::>>(); - let expected_songs = paths[..2] + let expected_songs = paths[..3] .iter() .zip(vec![(), ()].into_iter()) .map(|(path, expected_extra_info)| LibrarySong {