fmt fix...
CI / check (push) Successful in 1m13s
CI / docker (push) Successful in 2m9s

This commit is contained in:
Connor Johnstone
2026-04-01 22:54:44 -04:00
parent e198643c57
commit 31c9785ed2
+14 -3
View File
@@ -91,17 +91,28 @@ fn test_score_tracks_basic() {
// Matched tracks should score higher than unmatched ones
let mut matched: Vec<f64> = scored
.iter()
.filter(|t| t.title.as_deref().is_some_and(|n| n.starts_with("Song 1") || n.starts_with("Song 2") || n.starts_with("Song 3")))
.filter(|t| {
t.title.as_deref().is_some_and(|n| {
n.starts_with("Song 1") || n.starts_with("Song 2") || n.starts_with("Song 3")
})
})
.map(|t| t.score)
.collect();
let mut unmatched: Vec<f64> = scored
.iter()
.filter(|t| t.title.as_deref().is_some_and(|n| n.starts_with("Song 4") || n.starts_with("Song 5")))
.filter(|t| {
t.title
.as_deref()
.is_some_and(|n| n.starts_with("Song 4") || n.starts_with("Song 5"))
})
.map(|t| t.score)
.collect();
matched.sort_by(|a, b| b.partial_cmp(a).unwrap());
unmatched.sort_by(|a, b| b.partial_cmp(a).unwrap());
assert!(matched[0] > unmatched[0], "matched tracks should score higher than unmatched");
assert!(
matched[0] > unmatched[0],
"matched tracks should score higher than unmatched"
);
}
#[test]