Type: test that Show Similar Fonts puts a family without numbers first when asked about it

The test now lists that family last, so it passes only when the family
asked about is moved to the front and the others keep their order.
This commit is contained in:
dotCooCoo
2026-11-16 06:00:19 -08:00
parent f76735fcb4
commit 9973247dfc
+4 -3
View File
@@ -140,7 +140,8 @@ fn a_family_without_numbers_comes_after_the_measured_ones() {
// The measured families keep the order they have without it.
let measured: Vec<String> = order.iter().filter(|f| *f != NUMBERLESS_FAMILY).cloned().collect();
assert_eq!(measured, db.similar_families("Source Sans 3", &families[1..]));
// Asked about itself, it comes first, and the families it shares no number with keep their
// order in the list.
assert_eq!(db.similar_families(NUMBERLESS_FAMILY, &families), families);
// Asked about itself, it comes first even from the end of the list, and the families it shares
// no number with keep their order in the list.
let last = names(&["JetBrains Mono", "Source Serif 4", "Inter", HEIGHTLESS_FAMILY, "Source Sans 3", NUMBERLESS_FAMILY]);
assert_eq!(db.similar_families(NUMBERLESS_FAMILY, &last), families);
}