MCPcopy Create free account
hub / github.com/enowdev/enowX-Coder / test_search_files_match

Function test_search_files_match

src-tauri/src/tools/executor.rs:925–951  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

923
924 #[tokio::test]
925 async fn test_search_files_match() {
926 let sandbox_path = with_sandbox("search_files");
927
928 tokio::fs::write(sandbox_path.join("test.rs"), "fn hello() {}")
929 .await
930 .expect("create test.rs");
931 tokio::fs::write(sandbox_path.join("ignore.txt"), "no match here")
932 .await
933 .expect("create ignore.txt");
934
935 let executor = ToolExecutor::new(sandbox_path);
936
937 let call = ToolCall {
938 tool: ToolName::SearchFiles,
939 input: serde_json::json!({
940 "pattern": "fn hello",
941 "path": "."
942 }),
943 };
944 let result = executor.execute(call).await;
945 assert!(!result.is_error, "search should succeed: {}", result.output);
946 assert!(result.output.contains("test.rs"));
947 assert!(result.output.contains("fn hello() {}"));
948 assert!(!result.output.contains("ignore.txt"));
949
950 cleanup("search_files");
951 }
952
953 #[tokio::test]
954 async fn test_search_files_invalid_regex() {

Callers

nothing calls this directly

Calls 3

with_sandboxFunction · 0.85
cleanupFunction · 0.85
executeMethod · 0.80

Tested by

no test coverage detected