Retype: the null more test adds a font so a new search is told apart

When ten or fewer fonts match, adding more to the exhausted list returns
the same list as a new search, so the null more assertion could not tell
the two apart. The test now adds a font to the list before the null more
call, and only a new search drops it.
This commit is contained in:
dotCooCoo committed 2026-11-19 05:36:53 -08:00
1 parent 16de36545c
commit 25bb2abfc8
1 file changed
+3 -1
+3 -1
View File
@@ -97,7 +97,9 @@ fn more_adds_fonts_until_none_is_left() {
}
assert_eq!(last["more"], json!(false), "{last}");
assert_eq!(app.run("retype.find", json!({"more": true})).unwrap(), last, "nothing is left to add");
// A null more is omitted: a new search lists the first ten again.
// A null more is omitted: a new search lists the first ten again. A font added to the list
// tells the new search apart from adding more when ten or fewer fonts match.
app.ui.retype.fonts.push(super::Found { family: "Not Found".into(), style: "Regular".into(), matched: 0 });
assert_eq!(app.run("retype.find", json!({"more": null})).unwrap(), first);
// Before any search, more is a first search.
app.run("retype.reset", json!({})).unwrap();