rho-coding-agent 2.29.0

A fast Rust agent harness with a small footprint and opinionated defaults
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

#[test]
fn repeated_atomic_updates_replace_existing_contents() {
    let directory = tempfile::tempdir().unwrap();
    let path = directory.path().join("result.json");

    write_bytes_atomically(&path, br#"{"n":1}"#).unwrap();
    assert_eq!(fs::read_to_string(&path).unwrap(), r#"{"n":1}"#);

    write_bytes_atomically(&path, br#"{"n":2}"#).unwrap();
    assert_eq!(fs::read_to_string(&path).unwrap(), r#"{"n":2}"#);

    write_bytes_atomically(&path, br#"{"n":3,"ok":true}"#).unwrap();
    assert_eq!(fs::read_to_string(&path).unwrap(), r#"{"n":3,"ok":true}"#);
}