AkurAI Build
Menu

cosmic-mobile

public

Latest change bd10038fdf127d3b0f9f4ddc6c5afd463c4d2e34 - Calendar: iOS month grid, today/selection, event dots, day agenda, timed events via chrono by AkurAI Build

#[path = "../src/core_apps.rs"]
mod core_apps;
#[test]
fn calendar_when_accepts_optional_time() {
    assert!(core_apps::parse_when("2026-09-06").is_some());
    assert!(core_apps::parse_when("2026-09-06 14:30").is_some());
    assert!(core_apps::parse_when("2026-9-6").is_none());
    assert!(core_apps::parse_when("2026-02-30").is_none());
    assert!(core_apps::parse_when("2026-09-06 25:00").is_none());
}
#[test]
fn records_validate_and_roundtrip() {
    let root = std::env::temp_dir().join(format!("buios-core-{}", std::process::id()));
    let mut store = core_apps::Store::load(root.clone()).unwrap();
    assert!(store.add("Contacts", "", "+3541234567").is_err());
    assert!(store.add("Calendar", "2026-02-30", "Meeting").is_err());
    store
        .add("Contacts", "Demo contact", "+3541234567")
        .unwrap();
    store.add("Calendar", "2028-02-29", "Demo meeting").unwrap();
    store
        .add("Messages", "+3541234567", "Demo message")
        .unwrap();
    let loaded = core_apps::Store::load(root.clone()).unwrap();
    assert_eq!(loaded.rows.len(), 3);
    assert_eq!(loaded.rows[2].3, "Simulated — not sent");
    std::fs::remove_file(root).unwrap();
}