Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(tools): add tests for native ops and subagent host types

Steven Enamakel1f1f565d3d78
diff --git a/crates/openhuman-core/src/agent/subagent_host/types_tests.rs b/crates/openhuman-core/src/agent/subagent_host/types_tests.rs
index 4925044bb2..65854fbf9f 100644
--- a/crates/openhuman-core/src/agent/subagent_host/types_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/types_tests.rs
@@ -9,7 +9,7 @@ fn legacy_subagent_usage_keeps_its_wire_shape_and_does_not_claim_a_charge() {
let mut usage: SubagentUsage = serde_json::from_value(raw.clone()).unwrap();
assert_eq!(usage.cost_source, crate::agent::cost::CostSource::Unknown);
assert_eq!(usage.cost().usd(), None);
- assert_eq!(serde_json::to_value(&usage).unwrap(), raw);
+ assert_eq!(serde_json::to_value(usage).unwrap(), raw);
usage.cost_source = crate::agent::cost::CostSource::Charged;
let charged = serde_json::to_value(&usage).unwrap();
assert_eq!(charged["cost_source"], "charged");
diff --git a/crates/openhuman-core/src/tools/native_ops.rs b/crates/openhuman-core/src/tools/native_ops.rs
index 5bfcbb72bc..df20950612 100644
--- a/crates/openhuman-core/src/tools/native_ops.rs
+++ b/crates/openhuman-core/src/tools/native_ops.rs
@@ -224,7 +224,3 @@ pub async fn execute_tool(
result,
})
}
-
-#[cfg(test)]
-#[path = "ops_tests.rs"]
-mod tests;
diff --git a/crates/openhuman-core/src/tools/ops_tests.rs b/crates/openhuman-core/src/tools/ops_tests.rs
index 376eb723aa..99b0e4cbc1 100644
--- a/crates/openhuman-core/src/tools/ops_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests.rs
@@ -35,7 +35,7 @@ fn assert_contains_all(names: &[String], expected: &[&str]) {
fn only_json_content(result: &ToolResult) -> &serde_json::Value {
match result.content.as_slice() {
- [ToolContent::Json { data }] => &data,
+ [ToolContent::Json { data }] => data,
other => panic!("expected a single JSON content block, got {other:?}"),
}
}