diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py index 9c35ce091dc..c111cca1e5f 100644 --- a/codespell_lib/tests/test_basic.py +++ b/codespell_lib/tests/test_basic.py @@ -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],