rho-coding-agent 3.12.0

A fast Rust agent harness with a small footprint and opinionated defaults
Documentation
use std::collections::BTreeMap;

use super::validate_stdio_environment;

// Failure mode: on Windows, two sources set one child variable because their
// names differ only in case, and the later silently replaces the earlier.
// Owner layer: MCP stdio config validation.
#[test]
fn names_that_differ_only_in_case_collide_on_windows() {
    let cases = [("TOKEN", "token"), ("Ä", "ä")];
    for (literal, secret) in cases {
        let env = BTreeMap::from([(literal.to_owned(), "value".to_owned())]);
        let env_from_env = BTreeMap::from([(secret.to_owned(), "SOURCE".to_owned())]);
        assert!(
            validate_stdio_environment(&env, &env_from_env, &[]).is_err(),
            "{literal} and {secret} were both accepted"
        );
    }
    let env = BTreeMap::from([("TOKEN".to_owned(), "value".to_owned())]);
    assert!(validate_stdio_environment(&env, &BTreeMap::new(), &["token".to_owned()]).is_err());
}