5 Commits

Author SHA1 Message Date
Bel LaPointe
060a8dfb3b new tests 2025-12-02 17:47:12 -07:00
Bel LaPointe
3d7ebcf9bc drop one debug 2025-12-02 17:42:36 -07:00
Bel LaPointe
51f10b7944 shush warn 2025-12-02 17:40:25 -07:00
Bel LaPointe
9ed6b48806 shhhh warning 2025-12-02 17:36:29 -07:00
Bel LaPointe
a867809cb8 use to shush warn 2025-12-02 17:35:57 -07:00

View File

@@ -34,8 +34,7 @@ fn main() {
for file in files.files.iter() { for file in files.files.iter() {
println!( println!(
"{} => {}", "{}",
file.file,
serde_yaml::to_string(&file.events().unwrap().snapshot().unwrap()).unwrap(), serde_yaml::to_string(&file.events().unwrap().snapshot().unwrap()).unwrap(),
); );
} }
@@ -203,13 +202,12 @@ impl File {
if !after.contains(before) { if !after.contains(before) {
self.append(Delta::remove_at(before.clone(), now))?; self.append(Delta::remove_at(before.clone(), now))?;
let now = Delta::now_time(); let now = Delta::now_time();
if let Some(due) = before.next_due(now.clone()) { let due = before.must_next_due(now.clone());
if due >= now { if due >= now {
self.append(Delta::add_at(before.clone(), due))?; self.append(Delta::add_at(before.clone(), due))?;
} }
} }
} }
}
for after in after.iter() { for after in after.iter() {
if !before.contains(after) { if !before.contains(after) {
self.append(Delta::add_at(after.clone(), now))?; self.append(Delta::add_at(after.clone(), now))?;
@@ -474,6 +472,21 @@ mod test_file {
}); });
} }
#[test]
fn test_schedule_cron_resolve_reschedules() {
panic!("not impl");
}
#[test]
fn test_schedule_duration_resolve_reschedules() {
panic!("not impl");
}
#[test]
fn test_schedule_date_resolve_does_not_reschedule() {
panic!("not impl");
}
#[test] #[test]
fn test_schedule_date_future_with_snapshot_between_scheduled_and_fired() { fn test_schedule_date_future_with_snapshot_between_scheduled_and_fired() {
tests::with_dir(|d| { tests::with_dir(|d| {
@@ -990,6 +1003,7 @@ mod tests {
f.sync_all().unwrap(); f.sync_all().unwrap();
} }
#[allow(dead_code)]
pub fn file_contains(d: &tempdir::TempDir, fname: &str, content: &str) { pub fn file_contains(d: &tempdir::TempDir, fname: &str, content: &str) {
let p = d.path().join(&fname); let p = d.path().join(&fname);
let file_content = file_content(&p.to_str().unwrap().to_string()); let file_content = file_content(&p.to_str().unwrap().to_string());