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

Source from the content-addressed store, hash-verified

655
656 #[test]
657 fn test_parse_pre_tool_use() {
658 let hook = make_hook();
659 let input = br#"{
660 "sessionId": "s1",
661 "toolName": "run_terminal_command",
662 "toolUseId": "tu-1",
663 "toolInput": {"command": "cargo test"},
664 "cwd": "/repo"
665 }"#;
666 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
667 assert_eq!(event.tool_name.as_deref(), Some("run_terminal_command"));
668 assert_eq!(event.tool_use_id.as_deref(), Some("tu-1"));
669 }
670
671 #[test]
672 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