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

Function test_parse_pre_tool_use

atomic-agent/src/hooks/grok.rs:599–611  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597
598 #[test]
599 fn test_parse_pre_tool_use() {
600 let hook = make_hook();
601 let input = br#"{
602 "sessionId": "s1",
603 "toolName": "run_terminal_command",
604 "toolUseId": "tu-1",
605 "toolInput": {"command": "cargo test"},
606 "cwd": "/repo"
607 }"#;
608 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
609 assert_eq!(event.tool_name.as_deref(), Some("run_terminal_command"));
610 assert_eq!(event.tool_use_id.as_deref(), Some("tu-1"));
611 }
612
613 #[test]
614 fn test_parse_post_tool_use() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected