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:600–612  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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