Skip to content

fix: @Dsuf off-by-one drops ordinal suffix for day 31#139

Draft
Koan-Bot wants to merge 1 commit into
cpan-authors:mainfrom
Koan-Bot:koan.atoomic/fix-dsuf-day31-off-by-one
Draft

fix: @Dsuf off-by-one drops ordinal suffix for day 31#139
Koan-Bot wants to merge 1 commit into
cpan-authors:mainfrom
Koan-Bot:koan.atoomic/fix-dsuf-day31-off-by-one

Conversation

@Koan-Bot
Copy link
Copy Markdown

@Koan-Bot Koan-Bot commented May 7, 2026

What

Fix format_o (%o) producing bare "31" instead of "31st" (or
language-equivalent suffix) on the 31st day of the month.

Why

20 language modules declared @Dsuf with only 31 elements (indices
0–30). Since format_o accesses $dsuf->[$day] where $day is
1–31, day 31 read index 31 → undef, producing no suffix and an
uninitialized value warning under use warnings.

8 modules were visibly affected (no custom format_o override):
Romanian, Amharic, Tigrinya, TigrinyaEritrean, TigrinyaEthiopian,
Arabic, Occitan, Spanish. The other 12 had the same short array but
were masked by custom format_o implementations.

How

  • Extended all @Dsuf arrays to 32 elements (indices 0–31)
  • Tightened lang-data.t validation from >= 31 to >= 32
  • Added regression test: format_o on day 31 for every language

Testing

Full test suite passes (1523 tests across 39 files).

🤖 Generated with Claude Code


Quality Report

Changes: 21 files changed, 41 insertions(+), 24 deletions(-)

Code scan: clean

Tests: skipped

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

20 language modules had @Dsuf with only 31 elements (indices 0-30).
format_o accesses $dsuf->[$day] where $day is 1-31, so day 31
reads index 31 which was undef — producing "31" with no suffix
and an uninitialized value warning.

Visible in 8 modules without format_o overrides (Romanian, Amharic,
Tigrinya, TigrinyaEritrean, TigrinyaEthiopian, Arabic, Occitan,
Spanish). The remaining 12 modules had the same short array but
were masked by custom format_o implementations.

Fix: extend all @Dsuf arrays to 32 elements. Tighten the
lang-data.t validation threshold from >= 31 to >= 32 and add
a regression test exercising format_o on day 31 for every language.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant