| 456 | |
| 457 | #[tokio::test] |
| 458 | async fn test_insert_append() { |
| 459 | let test_base = TestBase::new().await.with_file(("test.txt", "existing")).await; |
| 460 | |
| 461 | let tool = FsWrite::Insert(Insert { |
| 462 | path: test_base.join("test.txt").to_string_lossy().to_string(), |
| 463 | content: "appended".to_string(), |
| 464 | insert_line: None, |
| 465 | }); |
| 466 | |
| 467 | assert!(tool.execute(None, &test_base).await.is_ok()); |
| 468 | |
| 469 | let content = tokio::fs::read_to_string(test_base.join("test.txt")).await.unwrap(); |
| 470 | assert_eq!(content, "existing\nappended"); |
| 471 | } |
| 472 | |
| 473 | #[tokio::test] |
| 474 | async fn test_fs_write_validate_empty_path() { |