test(themes): keep every built-in on the page that lists them

The themes page names all nine one by one and its description counts them,
so a tenth added to `BUILTINS` would leave the page wrong twice over: a
theme in the picker that nobody wrote down, under a sentence claiming
nine. Themes are the kind of thing that gets added.

Matched on display names, because the page is written for someone reading
the picker — `rose_pine` is "Rosé Pine" there, accent and all. Dropping
Harbor from the page fails it.

The check that prompted this found nothing wrong anywhere else, which is
worth recording: all nine themes, all eighteen detected agents, and all
seven agents with installable hooks are already named on their pages.
Two of those looked like gaps first time round and were mine, not the
docs': `harbor` matched nothing because the page says "Harbor", and
`OhMyPi` because it says "Oh My Pi". A name-matching sweep is only as good
as its idea of how names are written.
This commit is contained in:
l0ng-ai
2026-08-16 15:14:53 +08:00
parent 5fc97d5d06
commit 364dbeedbd
+26
View File
@@ -1288,6 +1288,32 @@ mod tests {
}
}
/// Every built-in theme is on the page that lists them.
///
/// The page names them one by one and calls them "Nine built-ins", so a
/// tenth added here leaves the page wrong in two places at once — a
/// reader counting the table against the picker finds a theme nobody
/// wrote down.
///
/// Display names rather than ids, because the page is written for someone
/// reading the picker: `rose_pine` is "Rosé Pine" there, accent and all.
#[test]
fn every_built_in_theme_is_on_the_themes_page() {
const PAGE: &str = include_str!("../../docs/customization/themes.mdx");
let mut absent = Vec::new();
for theme in builtins() {
if !PAGE.contains(&theme.name) {
absent.push(theme.name.clone());
}
}
assert!(
absent.is_empty(),
"these built-in themes are not on the themes page: {absent:?}"
);
assert_eq!(builtins().len(), 9, "the page's description counts them");
}
#[test]
fn dark_is_inferred_from_background() {
let dark: Vec<_> = builtins()