Skip to content

Commit

Permalink
Demonstrate issue with typographic apostrophe U+2019 (’)
Browse files Browse the repository at this point in the history
We miss misspellings using the typographic apostrophe or acute accent
U+2019 (’) because the typos in our dictionaries use the typewriter
apostrophe U+0027 (').
  • Loading branch information
DimitriPapadopoulos committed Aug 1, 2023
1 parent 67f67fd commit 9211c28
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions codespell_lib/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,19 @@ def test_basic(
assert cs.main(tmp_path) == 0


def test_default_word_parsing(
tmp_path: Path,
capsys: pytest.CaptureFixture[str],
) -> None:
fname = tmp_path / "apostrophe"
with fname.open("a") as f:
f.write("`woudn't`\n") # ' is U+0027
assert cs.main(fname) == 1, "misspelling containing typewriter apostrophe U+0027"
with fname.open("a") as f:
f.write("`woudn’t`\n") # ’ is U+2019
assert cs.main(fname) == 2, "misspelling containing typographic apostrophe U+2019"


def test_bad_glob(
tmp_path: Path,
capsys: pytest.CaptureFixture[str],
Expand Down

0 comments on commit 9211c28

Please sign in to comment.