agent-hub-runtime 0.6.0

AgentHub desktop and companion CLI runtime for Tauri applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;
#[test]
fn delivers_readable_context_and_removes_only_owned_packets_on_clear() {
    let root = tempfile::tempdir().unwrap();
    let packets = Packets::new(root.path().into());
    let packet = packets.prepare("Change the heading", &[]).unwrap();
    assert_eq!(
        std::fs::read_to_string(&packet.context_path).unwrap(),
        "Change the heading"
    );
    let unrelated = root.path().join("keep.txt");
    std::fs::write(&unrelated, "keep").unwrap();
    packets.clear();
    assert!(!std::path::Path::new(&packet.context_path).exists());
    assert!(unrelated.exists());
}