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

Function test_parse_pre_tool

atomic-agent/src/hooks/copilot.rs:662–675  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

660
661 #[test]
662 fn test_parse_pre_tool() {
663 let hook = make_hook();
664 let input = br#"{
665 "session_id": "s1",
666 "toolName": "edit",
667 "toolArgs": {"filePath": "src/main.rs"},
668 "tool_use_id": "call-42"
669 }"#;
670 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
671 assert_eq!(event.session_id, "s1");
672 assert_eq!(event.event_type, HookType::PreToolUse);
673 assert_eq!(event.tool_name.as_deref(), Some("edit"));
674 assert_eq!(event.tool_use_id.as_deref(), Some("call-42"));
675 }
676
677 #[test]
678 fn test_parse_pre_tool_snake_case() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected