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

Function test_parse_pre_tool

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

Source from the content-addressed store, hash-verified

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