tests pass
parent
631b4cab32
commit
38e6e19d7b
15
src/main.rs
15
src/main.rs
|
|
@ -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,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue