Update UT
All checks were successful
Cargo CI / Lint (pull_request) Successful in 1m8s
Cargo CI / Build and Test (pull_request) Successful in 2m4s

This commit is contained in:
Wojciech Kozlowski 2025-01-04 22:38:19 +01:00
parent 19f201e1ac
commit 91b671c668

View File

@ -107,6 +107,7 @@ mod tests {
// Drop ownership so that filtering is truly only on type.
album.tracks.clear();
assert_eq!(album.get_ownership(), AlbumOwnership::None);
album.meta.info.primary_type = None;
assert!(filter.filter_album(&album));
@ -142,10 +143,6 @@ mod tests {
assert_ne!(album.get_ownership(), AlbumOwnership::None);
assert!(filter.filter_album(&album));
// Remove non-filtered type.
album.meta.info.secondary_types.remove(0);
assert!(filter.filter_album(&album));
// Add another filtered type.
let types = &mut album.meta.info.secondary_types;
types.push(AlbumSecondaryType::Soundtrack);
@ -155,6 +152,14 @@ mod tests {
album.tracks.clear();
assert_eq!(album.get_ownership(), AlbumOwnership::None);
assert!(!filter.filter_album(&album));
// Remove one of the two filtered types.
album.meta.info.secondary_types.pop();
assert!(!filter.filter_album(&album));
// Remove the second filtered type. Should now be included by primary type.
album.meta.info.secondary_types.pop();
assert!(filter.filter_album(&album));
}
#[test]