Test: resolve attribute prefixes in the namespace check (#974)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Eduardo Garcia
2026-10-19 17:12:53 -03:00
co-authored by Claude Sonnet 5.5
parent 601823d98c
commit a9031d63e1
+9
View File
@@ -231,6 +231,15 @@ fn every_written_xml_part_binds_its_prefixes() {
match r.read_resolved_event() {
Ok((ns, Event::Start(e) | Event::Empty(e))) => {
assert!(!matches!(ns, ResolveResult::Unknown(_)), "{name}: unbound prefix on <{}>", String::from_utf8_lossy(e.name().as_ref()));
for attr in e.attributes() {
let attr = attr.unwrap_or_else(|err| panic!("{name}: bad attribute: {err}"));
let (ns, _) = r.resolver().resolve_attribute(attr.key);
assert!(
!matches!(ns, ResolveResult::Unknown(_)),
"{name}: unbound prefix on attribute {}",
String::from_utf8_lossy(attr.key.as_ref())
);
}
}
Ok((_, Event::Eof)) => break,
Ok(_) => {}