Compare commits
5 Commits
053071f4be
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
060a8dfb3b | ||
|
|
3d7ebcf9bc | ||
|
|
51f10b7944 | ||
|
|
9ed6b48806 | ||
|
|
a867809cb8 |
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user