| 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() { |