test_grep_with_brace_expansion_filter() — langchain Function Reference
Architecture documentation for the test_grep_with_brace_expansion_filter() function in test_file_search.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 5248efe6_1563_c679_342c_4f7bb4166175["test_grep_with_brace_expansion_filter()"] cc6c9310_5391_59ed_60fd_270a44975195["TestFilesystemGrepSearch"] 5248efe6_1563_c679_342c_4f7bb4166175 -->|defined in| cc6c9310_5391_59ed_60fd_270a44975195 style 5248efe6_1563_c679_342c_4f7bb4166175 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py lines 333–369
def test_grep_with_brace_expansion_filter(self) -> None:
"""Test grep with brace expansion in include filter."""
middleware = StateFileSearchMiddleware()
state: AnthropicToolsState = {
"messages": [],
"text_editor_files": {
"/src/main.ts": {
"content": ["const x = 1"],
"created_at": "2025-01-01T00:00:00",
"modified_at": "2025-01-01T00:00:00",
},
"/src/App.tsx": {
"content": ["const y = 2"],
"created_at": "2025-01-01T00:00:00",
"modified_at": "2025-01-01T00:00:00",
},
"/src/main.py": {
"content": ["z = 3"],
"created_at": "2025-01-01T00:00:00",
"modified_at": "2025-01-01T00:00:00",
},
},
}
result = middleware._handle_grep_search(
pattern="const",
path="/",
include="*.{ts,tsx}",
output_mode="files_with_matches",
state=state,
)
assert isinstance(result, str)
assert "/src/main.ts" in result
assert "/src/App.tsx" in result
assert "/src/main.py" not in result
Domain
Subdomains
Source
Frequently Asked Questions
What does test_grep_with_brace_expansion_filter() do?
test_grep_with_brace_expansion_filter() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py.
Where is test_grep_with_brace_expansion_filter() defined?
test_grep_with_brace_expansion_filter() is defined in libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py at line 333.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free