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

Function test_parse_pre_tool

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

Source from the content-addressed store, hash-verified

667
668 #[test]
669 fn test_parse_pre_tool() {
670 let hook = make_hook();
671 let input = br#"{
672 "session_id": "s1",
673 "toolName": "edit",
674 "toolArgs": {"filePath": "src/main.rs"},
675 "tool_use_id": "call-42"
676 }"#;
677 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
678 assert_eq!(event.session_id, "s1");
679 assert_eq!(event.event_type, HookType::PreToolUse);
680 assert_eq!(event.tool_name.as_deref(), Some("edit"));
681 assert_eq!(event.tool_use_id.as_deref(), Some("call-42"));
682 }
683
684 #[test]
685 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