diff --git a/crates/domistream/tests/http.rs b/crates/domistream/tests/http.rs
index 477981f..ff81ea5 100644
--- a/crates/domistream/tests/http.rs
+++ b/crates/domistream/tests/http.rs
@@ -497,6 +497,24 @@ fn applist_caps() {
);
}
+#[test]
+fn applist_cap_is_reachable_with_full_apps() {
+ // Hosts write four elements per app (App, AppTitle, ID, IsHdrSupported; the host writer does too): a list of
+ // MAX_APPS such apps plus the root must fit the XML element cap, so a list at the app cap parses (one app more is
+ // refused, by whichever cap comes first; `applist_caps` checks the app cap itself with three-element apps).
+ use domistream::http::applist::MAX_APPS;
+ let full = |n: usize| {
+ (0..n)
+ .map(|i| format!("g{i}1"))
+ .collect::()
+ };
+ assert!(1 + 4 * MAX_APPS <= MAX_XML_ELEMENTS, "root + 4 per app = {} elements", 1 + 4 * MAX_APPS);
+ let apps = http::parse_app_list(&xml_root(200, &full(MAX_APPS))).expect("a full list at the app cap");
+ assert_eq!(apps.len(), MAX_APPS);
+ assert!(apps.iter().all(|a| a.hdr_supported));
+ assert_err!(http::parse_app_list(&xml_root(200, &full(MAX_APPS + 1))), Error::TooLarge { .. });
+}
+
// ================================================================================================ launch
#[test]