https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41719

--- Comment #4 from Chris Nighswonger 
<[email protected]> ---
Created attachment 202134
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202134&action=edit
Bug 41719: Add rendering test coverage for Labels and Patroncards

Extends t/db_dependent/Labels/t_Label.t with subtests for:
- draw_label_text() layout math (text_llx/text_lly pinned to the
  _BIB geometry contract, downward text flow)
- draw_guide_box() PDF stream output
- All supported barcode types (CODE39, CODE39MOD, CODE39MOD10,
  COOP2OF5, INDUSTRIAL2OF5, EAN13), asserting no barcode-generation
  warning fires per type (Label.pm converts generation failures to
  warns, so absence-of-death alone cannot detect breakage)
- create_label() printing type orchestration (BIB/BAR/BIBBAR/BARBIB),
  including the geometric contract distinguishing BIBBAR from BARBIB

Creates t/db_dependent/Patroncards/t_Patroncard.t with subtests for:
- draw_guide_box(), draw_guide_grid(), draw_text()
- draw_barcode() across all five dispatched types; the CODE39MOD and
  CODE39MOD10 rows fail until Bug 43095 lands (missing
  Algorithm::CheckDigits import in Patroncard.pm, surfaced by this
  coverage work)
- draw_image()
- End-to-end PDF output, asserting Koha-originated content (text
  blocks at layout-computed coordinates, guide-box rectangle) rather
  than only the PDF header PDF::Reuse emits unconditionally

Both files skip cleanly with a clear message when PDF::Reuse < 0.43
is installed (Bug 41717), instead of failing with opaque internals.
A shared capture_pdf_end() helper centralises the End() output
capture and dies on End() failure instead of swallowing it. Known
Bug 41718 and PDF::Reuse prJpeg warnings are filtered against their
exact observed text; unexpected warnings are forwarded to
Test::NoWarnings.

Test plan:
1) Apply Bug 41717 (or cpanm PDF::[email protected] PDF::Reuse::[email protected])
2) prove t/db_dependent/Labels/t_Label.t
   -- all tests pass
3) prove t/db_dependent/Patroncards/t_Patroncard.t
   -- draw_barcode() subtest fails on CODE39MOD/CODE39MOD10 with
   "Undefined subroutine ... CheckDigits", demonstrating Bug 43095
4) Apply Bug 43095 and re-run step 3 -- all tests pass

AI Assistance: Claude Opus 4.5 drafted the original test code and
debugged a PDF::Reuse issue (GitHub cnighswonger/PDF-Reuse#24, fixed
in 0.43). Claude Fable 5 (Anthropic) reviewed the first revision,
identified tautological assertions, unexercised checksum paths, and
the latent Bug 43095 crash, and drafted the revised tests. OpenAI
Codex reviewed the revision (helper error propagation, warning-filter
precision). Human author directed the approach, rejected an initial
implementation that merely exercised PDF::Reuse rather than Koha
code, chose to surface rather than skip the Bug 43095 failure,
reviewed all changes, and verified test behavior.

Assisted-by: Claude Opus 4.5 (Anthropic)
Assisted-by: Claude Fable 5 (Anthropic)
Assisted-by: Codex (OpenAI)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to