kanbrain-core 0.1.0

The core of kanbrain (the `kb` command line and the kanban app): entries, markdown storage, tags and time tracking. Internal: its API follows kanbrain's versions and isn't meant for other crates.
Documentation
use super::*;

#[test]
fn hand_typed_and_stored_formats_agree() {
    let typed = parse_ts("2026-09-24 10:12").unwrap();
    assert_eq!(parse_ts(&fmt_ts(typed)), Some(typed));
    assert_eq!(parse_ts("yesterday"), None);
}

#[test]
fn ages() {
    assert_eq!(fmt_age(Duration::seconds(59)), "0m");
    assert_eq!(fmt_age(Duration::minutes(-5)), "0m");
    assert_eq!(fmt_age(Duration::minutes(65)), "1h");
    assert_eq!(fmt_age(Duration::days(3)), "3d");
    assert_eq!(fmt_age(Duration::days(15)), "2w");
}

#[test]
fn durations() {
    assert_eq!(fmt_dur(Duration::seconds(59)), "0m");
    assert_eq!(fmt_dur(Duration::minutes(65)), "1h 05m");
    assert_eq!(fmt_dur(Duration::minutes(-5)), "0m");
    assert_eq!(fmt_clock(Duration::seconds(3723)), "01:02:03");
}