diff --git a/pttodoest/src/main.rs b/pttodoest/src/main.rs index c41a9d6..1aa926a 100755 --- a/pttodoest/src/main.rs +++ b/pttodoest/src/main.rs @@ -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"); + }); + }); + } } }