From 3fa54deaa7bbebc129e58504ba59cadb113eb051 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Tue, 1 Aug 2023 08:40:23 +0200 Subject: [PATCH] Test to demonstrate parsing issue with grave accent (`) Misspellings inside Markdown backticks are not detected because the backticks are part of the word. --- codespell_lib/tests/test_basic.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py index 9c35ce091dc..73c6304ff2a 100644 --- a/codespell_lib/tests/test_basic.py +++ b/codespell_lib/tests/test_basic.py @@ -159,6 +159,16 @@ 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 / "parsing" + with fname.open("a") as f: + f.write("`abandonned`\n") + assert cs.main(fname) == 1, "bad" + + def test_bad_glob( tmp_path: Path, capsys: pytest.CaptureFixture[str],