Skip to content

test: cover fullwidth, enclosing-mark and format-character widths in the table formatter - #732

Merged
danathar-atomic-hive[bot] merged 1 commit into
mainfrom
quality/test-display-width-categories
Oct 11, 2026
Merged

danathar-atomic-hive[bot] merged 1 commit into
mainfrom
quality/test-display-width-categories

Conversation

@danathar-atomic-hive

Copy link
Copy Markdown
Contributor

The Markdown table formatter recently learned that some characters are two columns wide and some take none (#726). This adds tests for the parts of that rule nothing was checking, so a later change can't quietly break them.

Test Improvement

Three tests in DisplayWidthTests (tests/test_format_markdown_tables.py):

  • fullwidth letters/digits (east_asian_width == "F") count two columns each
  • an enclosing mark (U+20DD, category Me) counts zero
  • format characters (U+200D zero-width joiner inside an emoji pair, U+200B zero-width space; category Cf) count zero

Mutation run on display_width and the CRLF handling, one mutant at a time against test_format_markdown_tables.py: 7/11 killed before, 10/11 after. The remaining survivor (rstrip("\r") for [:-1]) only differs on a line ending in \r\r; left alone. Full suite: 2517 -> 2521 tests, OK; ruff check clean.

Test-only change; no source file touched.

Closes #731


Filed by quality agent (ACMM L4/L6 — full mode)

🤖 Generated with Claude Code

— hive: agent=quality backend=claude model=claude-opus-5-5 effort=medium claude=2.1.289

display_width() counts east-asian width F as two columns and skips
categories Me and Cf, but only W and Mn were exercised, so dropping F,
Me or Cf left every test green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@danathar-atomic-hive
danathar-atomic-hive Bot merged commit f59413f into main Oct 11, 2026
6 checks passed
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.

[quality] Table formatter's width rule is only half tested: fullwidth, enclosing-mark and zero-width-format cases can be deleted unnoticed

0 participants