Add a "no tags" test for the library module

This commit is contained in:
Polochon-street 2022-10-24 10:07:19 +02:00
parent 08aba11e39
commit 8fad7701af

View File

@ -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] #[test]
fn test_analyze_paths() { fn test_analyze_paths() {
let (mut library, _temp_dir, _) = setup_test_library(); let (mut library, _temp_dir, _) = setup_test_library();
@ -2168,7 +2179,7 @@ mod test {
_library_song_from_database(connection, path) _library_song_from_database(connection, path)
}) })
.collect::<Vec<LibrarySong<()>>>(); .collect::<Vec<LibrarySong<()>>>();
let expected_songs = paths[..2] let expected_songs = paths[..3]
.iter() .iter()
.zip(vec![(), ()].into_iter()) .zip(vec![(), ()].into_iter())
.map(|(path, expected_extra_info)| LibrarySong { .map(|(path, expected_extra_info)| LibrarySong {