File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,24 @@ async def test_read_offset_beyond_eof(tmp_path):
6868 assert result .details ["linesReturned" ] == 0
6969
7070
71+ async def test_read_offset_zero_is_an_error (tmp_path ):
72+ f = tmp_path / "zero.txt"
73+ f .write_text ("a\n b\n c\n d" )
74+ result = await READ_TOOL .execute ("t7" , ReadArgs (path = str (f ), offset = 0 ))
75+ text = text_of (result )
76+ assert "1-indexed" in text
77+ assert result .details ["linesReturned" ] == 0
78+
79+
80+ async def test_read_limit_zero_has_no_bogus_note (tmp_path ):
81+ f = tmp_path / "lim.txt"
82+ f .write_text ("a\n b\n c\n d" )
83+ result = await READ_TOOL .execute ("t8" , ReadArgs (path = str (f ), limit = 0 ))
84+ text = text_of (result )
85+ assert result .details ["linesReturned" ] == 0
86+ assert "1-0" not in text
87+
88+
7189async def test_read_not_found (tmp_path ):
7290 result = await READ_TOOL .execute ("t6" , ReadArgs (path = str (tmp_path / "nope.txt" )))
7391 assert "not found" in text_of (result )
You can’t perform that action at this time.
0 commit comments