Skip to content

Improve test coverage and expand replacement table#14

Merged
mit-d merged 2 commits intomainfrom
refactor/test-improvements
Mar 29, 2026
Merged

Improve test coverage and expand replacement table#14
mit-d merged 2 commits intomainfrom
refactor/test-improvements

Conversation

@mit-d
Copy link
Copy Markdown
Owner

@mit-d mit-d commented Mar 29, 2026

Summary

  • Test rework: Grow test suite from 333 to 454 tests using fixtures, @pytest.mark.parametrize, and targeted edge cases across all test modules (checker, fixer, CLI, output)
  • Replacement table expansion: Change en/em dash mapping from -- to -, add 18 new fixable character mappings (hyphen variants, soft hyphen, bullets, dot leaders, arrows, math operators)
  • Update man page and CHANGELOG to document new fixable categories

Test plan

  • All 454 tests pass (uv run pytest tests/ -x -q)
  • Ruff lint clean (uv run ruff check src/ tests/)
  • ty type check clean (uvx ty check src/)
  • All pre-commit hooks pass
  • Verify new replacement mappings behave correctly with --fix on sample input
  • Spot-check man page rendering (man ./docs/check-unicode.1)

mit-d added 2 commits March 29, 2026 13:19
…cases

Grow test suite from 333 to 436 tests while improving structure:

- checker: add text= param tests, allow priority order, confusable
  edge cases, BOM boundaries, Finding.fixable property tests
- fixer: consolidate 4 replacement classes into parametrized table,
  add fix_text/strip_file direct tests, strip allow-list edge cases
- cli: parametrize exit codes, convert pipe tests to stdin_from
  fixture, add edge cases (empty stdin, no newline, halt on line 1),
  add _preprocess_argv unit tests
- output: add _make_finding helper, parametrize caret marker types,
  add empty/singular summary edge cases
- Change en/em dash replacement from '--' to '-'
- Add hyphen variants: U+2010 HYPHEN, U+2011 NON-BREAKING HYPHEN,
  U+2012 FIGURE DASH, U+2015 HORIZONTAL BAR, U+FE58 SMALL EM DASH
- Add soft hyphen (U+00AD) removal (invisible layout hint)
- Add bullets: U+2022 BULLET, U+2023 TRIANGULAR BULLET -> *,
  U+2043 HYPHEN BULLET -> -
- Add dot leaders: U+2024 -> ., U+2025 -> ..
- Add arrows: U+2190 -> <-, U+2192 -> ->, U+2191 -> ^, U+2193 -> v
- Add math operators: U+00D7 -> x, U+00F7 -> /, U+2044 -> /
@mit-d mit-d merged commit 465c52e into main Mar 29, 2026
4 checks passed
@mit-d mit-d deleted the refactor/test-improvements branch March 29, 2026 19:39
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