MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_aggregate_tool_usage

Function test_aggregate_tool_usage

atomic-agent/src/transcript/tests.rs:212–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

210
211#[test]
212fn test_aggregate_tool_usage() {
213 let entries = vec![
214 CondensedEntry::tool("Edit", Some("a.rs")),
215 CondensedEntry::tool("Edit", Some("b.rs")),
216 CondensedEntry::tool("Bash", Some("cargo test")),
217 CondensedEntry::tool("Read", Some("c.rs")),
218 ];
219 let tools = aggregate_tool_usage(&entries);
220 assert_eq!(tools.len(), 3);
221
222 let bash = tools.iter().find(|t| t.tool_name == "Bash").unwrap();
223 assert_eq!(bash.invocation_count, 1);
224 assert!(bash.files_affected.is_empty()); // Bash doesn't modify files
225
226 let edit = tools.iter().find(|t| t.tool_name == "Edit").unwrap();
227 assert_eq!(edit.invocation_count, 2);
228 assert_eq!(edit.files_affected, vec!["a.rs", "b.rs"]);
229}
230
231#[test]
232fn test_aggregate_tool_usage_dedup_files() {

Callers

nothing calls this directly

Calls 3

aggregate_tool_usageFunction · 0.85
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected