@@ -1429,7 +1429,7 @@ def run_codespell_stdin(
14291429 return output .count ("\n " )
14301430
14311431
1432- def test_stdin (tmp_path : Path ) -> None :
1432+ def test_stdin (tmp_path : Path , capsys : pytest . CaptureFixture [ str ] ) -> None :
14331433 """Test running the codespell executable."""
14341434 input_file_lines = 4
14351435 text = ""
@@ -1444,3 +1444,17 @@ def test_stdin(tmp_path: Path) -> None:
14441444 assert run_codespell_stdin (
14451445 text , args = args , cwd = tmp_path
14461446 ) == input_file_lines * (2 - int (single_line_per_error ))
1447+
1448+ with FakeStdin ("Thsi is a line" ):
1449+ result = cs .main ("-" , "-w" , std = True )
1450+ assert isinstance (result , tuple )
1451+ code , stdout , _ = result
1452+ assert stdout == "---\n This is a line"
1453+ assert code == 0
1454+
1455+ with FakeStdin ("Thsi is a line" ):
1456+ result = cs .main ("-" , "--stdin-single-line" , std = True )
1457+ assert isinstance (result , tuple )
1458+ code , stdout , _ = result
1459+ assert stdout == "1: Thsi ==> This\n "
1460+ assert code == 1
0 commit comments