Home / Function/ test_grep_no_matches() — langchain Function Reference

test_grep_no_matches() — langchain Function Reference

Architecture documentation for the test_grep_no_matches() function in test_file_search.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  2200f68a_1b93_83ff_0c3b_72127778a021["test_grep_no_matches()"]
  cc6c9310_5391_59ed_60fd_270a44975195["TestFilesystemGrepSearch"]
  2200f68a_1b93_83ff_0c3b_72127778a021 -->|defined in| cc6c9310_5391_59ed_60fd_270a44975195
  style 2200f68a_1b93_83ff_0c3b_72127778a021 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py lines 403–427

    def test_grep_no_matches(self) -> None:
        """Test grep with no matching content."""
        middleware = StateFileSearchMiddleware()

        state: AnthropicToolsState = {
            "messages": [],
            "text_editor_files": {
                "/src/main.py": {
                    "content": ["print('hello')"],
                    "created_at": "2025-01-01T00:00:00",
                    "modified_at": "2025-01-01T00:00:00",
                },
            },
        }

        result = middleware._handle_grep_search(
            pattern=r"TODO",
            path="/",
            include=None,
            output_mode="files_with_matches",
            state=state,
        )

        assert isinstance(result, str)
        assert result == "No matches found"

Domain

Subdomains

Frequently Asked Questions

What does test_grep_no_matches() do?
test_grep_no_matches() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py.
Where is test_grep_no_matches() defined?
test_grep_no_matches() is defined in libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py at line 403.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free