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

Function test_insert_append

crates/agent/src/agent/tools/fs_write.rs:458–471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

InsertClass · 0.85
to_stringMethod · 0.80
joinMethod · 0.80
with_fileMethod · 0.45

Tested by

no test coverage detected