AkurAI Build
Menu

cosmic-mobile

public

Latest change 760f88a8b46f92fbb34539f97d56ba639eaeb8c4 - Sort calendar agenda by date without rewriting records by AkurAI Build

#[path = "../src/core_apps.rs"]
mod core_apps;
#[test]
fn agenda_orders_dates_without_reordering_other_apps() {
    let path = std::env::temp_dir().join(format!("buios-agenda-{}", std::process::id()));
    let mut store = core_apps::Store::load(path.clone()).unwrap();
    store.add("Calendar", "2026-12-31", "Later").unwrap();
    store.add("Calendar", "2026-09-06", "Earlier").unwrap();
    store.add("Contacts", "Demo", "5550100").unwrap();
    let rows = store.for_app("Calendar");
    assert_eq!(rows.len(), 2);
    assert_eq!(rows[0].2, "Earlier");
    assert_eq!(store.rows[0].2, "Later");
    assert_eq!(store.for_app("Contacts").len(), 1);
    std::fs::remove_file(path).unwrap();
}