Home / Function/ test_grep_with_special_chars_in_pattern() — langchain Function Reference

test_grep_with_special_chars_in_pattern() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b0da9bdc_c6ba_8847_545f_5b6f0c284f01["test_grep_with_special_chars_in_pattern()"]
  4f81b5ee_096d_b9d6_73a1_343fbdcd7d93["TestGrepEdgeCases"]
  b0da9bdc_c6ba_8847_545f_5b6f0c284f01 -->|defined in| 4f81b5ee_096d_b9d6_73a1_343fbdcd7d93
  style b0da9bdc_c6ba_8847_545f_5b6f0c284f01 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_file_search.py lines 363–373

    def test_grep_with_special_chars_in_pattern(self, tmp_path: Path) -> None:
        """Test grep with special characters in pattern."""
        (tmp_path / "test.py").write_text("def test():\n    pass\n", encoding="utf-8")

        middleware = FilesystemFileSearchMiddleware(root_path=str(tmp_path), use_ripgrep=False)

        assert isinstance(middleware.grep_search, StructuredTool)
        assert middleware.grep_search.func is not None
        result = middleware.grep_search.func(pattern="def.*:")

        assert "/test.py" in result

Domain

Subdomains

Frequently Asked Questions

What does test_grep_with_special_chars_in_pattern() do?
test_grep_with_special_chars_in_pattern() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_file_search.py.
Where is test_grep_with_special_chars_in_pattern() defined?
test_grep_with_special_chars_in_pattern() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_file_search.py at line 363.

Analyze Your Own Codebase

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

Try Supermodel Free