test(domain): R5.7 port the contracts only the TS suites checked

612 leaves and 26 legacy ids (curation_leaves), region inference, R5.1 ledger rows,
generated folder lists, migration-map oracle entry by entry, overlay removal, halo
filter, CHG-000 and dollar-tag refusals; report-v2 fixtures moved to crates/core/tests
(sha256 unchanged).
This commit is contained in:
bchanot committed 2026-10-25 03:59:49 +01:00
1 parent 756b7ef34d
commit 0da7d3ab9f
11 files changed
+634 -11

No files matched your search

+24
View File
@@ -154,3 +154,27 @@ fn a_label_xml_cannot_carry_is_refused_never_replaced() {
}
assert!(compose_canvas(&draft, "main", &horse).is_err());
}
fn count(element: &Element, matches: &dyn Fn(&Element) -> bool) -> usize {
usize::from(matches(element))
+ element
.element_children()
.map(|c| count(c, matches))
.sum::<usize>()
}
/// `render.compose.test.ts` "never duplicates the filter on a root that already holds it"
/// (R5.7): composing a drawing that already carries the halo filter adds no second filter and no
/// second `<defs>` (the TypeScript composed twice on one DOM root; the core takes the root it
/// returned).
#[test]
fn the_halo_filter_is_never_duplicated_on_a_root_that_holds_it() {
let draft = draft();
let ids: HashSet<&str> = ["hip"].into_iter().collect();
let horse = sanitized(&common::repo_file(HORSE));
let once = compose_highlight(&draft, "main", horse, &ids, true).unwrap();
let twice = compose_highlight(&draft, "main", once, &ids, true).unwrap();
let halo = |e: &Element| e.qname == "filter" && e.attr("id") == Some("osteo-halo");
assert_eq!(count(&twice, &halo), 1);
assert_eq!(count(&twice, &|e: &Element| e.qname == "defs"), 1);
}