todos as failing tests

master
Bel LaPointe 2024-08-10 09:30:06 -06:00
parent 301fb6046f
commit 7344c660ed
1 changed files with 22 additions and 2 deletions

View File

@ -14,7 +14,7 @@ fn main() {
let mut db = DB::new(flags.path).unwrap();
match flags.add {
match flags.add.clone() {
Some(s) => {
let t = match flags.add_schedule {
Some(sch) => Task::from_string_schedule(s, sch),
@ -28,7 +28,14 @@ fn main() {
if flags.edit {
db = db.edit().expect("failed to edit")
}
db.save(flags.dry_run).expect("failed to save");
if flags.edit || flags.add.is_some() {
db.save(flags.dry_run).expect("failed to save");
}
if flags.list {
println!("{}", db.due().to_string());
}
}
#[derive(Debug, Parser)]
@ -47,6 +54,9 @@ struct Flags {
#[arg(short = 'd', long = "dry-run", default_value="false")]
dry_run: bool,
#[arg(short = 'l', long = "list", default_value="true")]
list: bool,
}
impl Flags {
@ -243,6 +253,16 @@ impl DB {
mod test_db {
use super::*;
#[test]
fn resolved_scheduled_recurring() {
assert!(false, "not impl")
}
#[test]
fn resolved_scheduled_non_recurring() {
assert!(false, "not impl")
}
#[test]
fn conflicting_save_handled() {
use std::ops::Add;