From 822515f87bd15baf6b5328f2efee4bd8547c7fdb Mon Sep 17 00:00:00 2001 From: argszero Date: Sat, 18 Jul 2026 13:58:26 +0800 Subject: [PATCH] emrg: add nonexistent path error test for grep_tool --- tests/test_grep_tool.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_grep_tool.py b/tests/test_grep_tool.py index 2ece1ca5..35732e2b 100644 --- a/tests/test_grep_tool.py +++ b/tests/test_grep_tool.py @@ -107,3 +107,14 @@ def test_skips_hidden_dirs(temp_cwd): tool = GrepTool() result = _run(tool.execute({"pattern": "binary", "path": str(temp_cwd)})) assert "No matches" in result.content + + +def test_grep_nonexistent_path(): + """Searching a non-existent path should return an error.""" + tool = GrepTool() + result = _run(tool.execute({ + "pattern": "import", + "path": "/nonexistent/path/xyzzy", + })) + assert result.error + assert "not found" in result.content.lower()