From 322b3d765c8ba86eb387a6f3eb277d95117e6d2a Mon Sep 17 00:00:00 2001 From: MyAIPlugins Date: Mon, 19 Oct 2026 18:32:07 +0200 Subject: [PATCH] test(pdf): a described shape is exactly one Figure The test checked that the description is there, so a Figure written twice would still pass. It now also counts the alt text entries. Suggested by the CodeRabbit review of this PR. Co-Authored-By: Claude Opus 5.5 --- crates/pdf/src/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/pdf/src/tests.rs b/crates/pdf/src/tests.rs index da61e7699..5a34df0e7 100644 --- a/crates/pdf/src/tests.rs +++ b/crates/pdf/src/tests.rs @@ -1903,6 +1903,7 @@ fn described_shapes_are_figures_with_their_description() { for (name, float) in cases { let raw = tagged_shape_pdf(Float { alt: described.clone(), ..float.clone() }, false); assert!(raw.contains("/Alt(Arrow pointing to the exit)"), "{name}: a described shape is a Figure with its description"); + assert_eq!(raw.matches("/Alt(").count(), 1, "{name}: the described shape is one Figure"); assert!(raw.contains("0 0 1 rg"), "{name}: the shape is drawn"); assert!(!tagged_shape_pdf(float.clone(), false).contains("/Alt("), "{name}: an undescribed shape stays an artifact"); let decorative = AltText { decorative: true, ..described.clone() };