mirror of
https://github.com/hanzoai/ide.git
synced 2026-10-30 18:33:54 +00:00
A ground-up desktop IDE: the Engram memory system, tree-sitter code intelligence, a sandboxed execution engine and a multi-agent coding engine, all in compiled Rust, on the VS Code workbench. Identity is Hanzo IAM (hanzo.id) through the Hanzo CLI, tools arrive over MCP from `hanzo-mcp`, models come from a local engine if one is running or api.hanzo.ai if not, and a running editor is a peer on the local ZAP bus at ~/.hanzo/ide.sock. The IDE and the CLI share one home at ~/.hanzo. Redistributed third-party software is listed in THIRD-PARTY-NOTICES.md.
56 lines
1.7 KiB
Rust
56 lines
1.7 KiB
Rust
// Integration test: Config persistence (set → get → overwrite → get)
|
|
|
|
use super::test_store;
|
|
|
|
#[test]
|
|
fn get_config_returns_none_for_missing_key() {
|
|
let store = test_store();
|
|
let result = store.get_config("nonexistent").unwrap();
|
|
assert!(result.is_none());
|
|
}
|
|
|
|
#[test]
|
|
fn set_and_get_config() {
|
|
let store = test_store();
|
|
store.set_config("theme", "dark").unwrap();
|
|
let value = store.get_config("theme").unwrap();
|
|
assert_eq!(value.as_deref(), Some("dark"));
|
|
}
|
|
|
|
#[test]
|
|
fn set_config_overwrites_existing() {
|
|
let store = test_store();
|
|
store.set_config("theme", "dark").unwrap();
|
|
store.set_config("theme", "light").unwrap();
|
|
let value = store.get_config("theme").unwrap();
|
|
assert_eq!(value.as_deref(), Some("light"));
|
|
}
|
|
|
|
#[test]
|
|
fn config_stores_json_values() {
|
|
let store = test_store();
|
|
let json = r#"{"auto_approve":true,"max_trade_usd":50.0}"#;
|
|
store.set_config("trading_policy", json).unwrap();
|
|
let value = store.get_config("trading_policy").unwrap().unwrap();
|
|
let parsed: serde_json::Value = serde_json::from_str(&value).unwrap();
|
|
assert_eq!(parsed["auto_approve"], true);
|
|
assert_eq!(parsed["max_trade_usd"], 50.0);
|
|
}
|
|
|
|
#[test]
|
|
fn config_handles_empty_value() {
|
|
let store = test_store();
|
|
store.set_config("empty_key", "").unwrap();
|
|
let value = store.get_config("empty_key").unwrap();
|
|
assert_eq!(value.as_deref(), Some(""));
|
|
}
|
|
|
|
#[test]
|
|
fn config_handles_special_characters() {
|
|
let store = test_store();
|
|
let val = "this has 'quotes' and \"double quotes\" and\nnewlines";
|
|
store.set_config("special", val).unwrap();
|
|
let result = store.get_config("special").unwrap().unwrap();
|
|
assert_eq!(result, val);
|
|
}
|