MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / test_ls_basic_directory

Function test_ls_basic_directory

crates/agent/src/agent/tools/ls.rs:368–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

366
367 #[tokio::test]
368 async fn test_ls_basic_directory() {
369 let test_base = TestBase::new()
370 .await
371 .with_file(("file1.txt", "content1"))
372 .await
373 .with_file(("file2.txt", "content2"))
374 .await;
375
376 let tool = Ls {
377 path: test_base.join("").to_string_lossy().to_string(),
378 depth: None,
379 ignore: None,
380 };
381
382 assert!(tool.validate(&test_base).await.is_ok());
383 let result = tool.execute(&test_base).await.unwrap();
384 assert_eq!(result.items.len(), 1);
385
386 if let ToolExecutionOutputItem::Text(content) = &result.items[0] {
387 assert!(content.contains("file1.txt"));
388 assert!(content.contains("file2.txt"));
389 }
390 }
391
392 #[tokio::test]
393 async fn test_ls_recursive() {

Callers

nothing calls this directly

Calls 4

to_stringMethod · 0.80
joinMethod · 0.80
with_fileMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected