MCPcopy Create free account
hub / github.com/AI45Lab/Code / create_test_files

Function create_test_files

core/src/context/fs_provider.rs:287–302  ·  view source on GitHub ↗
(dir: &Path)

Source from the content-addressed store, hash-verified

285 use tempfile::TempDir;
286
287 fn create_test_files(dir: &Path) -> anyhow::Result<()> {
288 let mut file1 = File::create(dir.join("test1.rs"))?;
289 writeln!(file1, "fn main() {{\n println!(\"Hello, world!\");\n}}")?;
290
291 let mut file2 = File::create(dir.join("test2.md"))?;
292 writeln!(
293 file2,
294 "# Test Document\n\nThis is a test document about Rust programming."
295 )?;
296
297 fs::create_dir(dir.join("subdir"))?;
298 let mut file4 = File::create(dir.join("subdir/test4.rs"))?;
299 writeln!(file4, "fn test() {{\n // Test function\n}}")?;
300
301 Ok(())
302 }
303
304 #[tokio::test]
305 async fn test_index_files() {

Callers 2

test_index_filesFunction · 0.85
test_search_simpleFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_index_filesFunction · 0.68
test_search_simpleFunction · 0.68