tests pass

main
Bel LaPointe 2023-11-27 10:14:55 -07:00
parent 631b4cab32
commit 38e6e19d7b
1 changed files with 14 additions and 1 deletions

View File

@ -47,6 +47,19 @@ fn add(f: &String, x: &Option<String>, tag: &Option<String>) -> Result<(), Strin
Ok(())
}
#[derive(Debug, Serialize)]
struct Log {
t: String,
d: u8,
xs: Vec<LogX>,
}
#[derive(Debug, Serialize)]
struct LogX {
d: u8,
x: String,
xs: Vec<String>,
}
fn log(f: &String, since: &Option<String>) -> Result<(), String> {
let since = parse_time(since)?;
let tsheet = load(&f)?;
@ -126,7 +139,7 @@ mod test_save_load {
X{t: 2, x: "ghi".to_string(), tag: "".to_string()},
]};
assert_eq!(
load("./src/testdata/standalone.yaml".to_string()).expect("cant load standalone.yaml"),
load(&"./src/testdata/standalone.yaml".to_string()).expect("cant load standalone.yaml"),
want,
);