some test edit

master
Bel LaPointe 2025-11-11 19:24:21 -07:00
parent 2076ebd6f4
commit 5bfd9e52c3
1 changed files with 16 additions and 0 deletions

View File

@ -647,5 +647,21 @@ mod edit {
});
});
}
#[test]
fn test_persist_edits_with_files() {
tests::with_dir(|d1| {
tests::write_file(&d1, "file", "- foo");
let p = d1.path().join("file").display().to_string();
let files = Files::new(&vec![p]);
tests::with_dir(|d2| {
build_dir(&d2, &files).expect("failed to build dir");
tests::file_contains(&d2, "file", "- foo");
tests::write_file(&d2, "file", "- foobar\n- bar");
persist_edits(&d2, &files).expect("failed to persist edits");
});
});
}
}
}