Improve test coverage and expand replacement table#14
Merged
Conversation
…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 -> /
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@pytest.mark.parametrize, and targeted edge cases across all test modules (checker, fixer, CLI, output)--to-, add 18 new fixable character mappings (hyphen variants, soft hyphen, bullets, dot leaders, arrows, math operators)Test plan
uv run pytest tests/ -x -q)uv run ruff check src/ tests/)uvx ty check src/)--fixon sample inputman ./docs/check-unicode.1)