Match the SVG parser refusal directly in the guard test

This commit is contained in:
Terra854 committed 2026-11-18 03:05:00 +08:00
1 parent 62d928f97d
commit ba146351ed
1 file changed
+3 -1
+3 -1
View File
@@ -49,7 +49,9 @@ fn original_xml_guards_run_before_repair_or_conversion() {
write!(attributes, " a{index}='x'").unwrap();
}
let rejected = format!("{opening}<g{attributes}>{image}</g></svg>");
let error = svg::parse_with(rejected.as_bytes(), empty_fonts).err().expect("original attribute limits must apply before URL repair");
let Err(error) = svg::parse_with(rejected.as_bytes(), empty_fonts) else {
panic!("original attribute limits must apply before URL repair");
};
assert!(error.to_string().contains("attribute"), "{error}");
let accepted = format!(