From a9031d63e1d3365056216178d526f71f27b1dd99 Mon Sep 17 00:00:00 2001 From: Eduardo Garcia Date: Mon, 19 Oct 2026 17:12:53 -0300 Subject: [PATCH] Test: resolve attribute prefixes in the namespace check (#974) Co-Authored-By: Claude Sonnet 5.5 --- crates/pptx/tests/comments.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/pptx/tests/comments.rs b/crates/pptx/tests/comments.rs index 1c4a7875..9713b0f4 100644 --- a/crates/pptx/tests/comments.rs +++ b/crates/pptx/tests/comments.rs @@ -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(_) => {}