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

Function test_parse_pre_tool

atomic-agent/src/hooks/cline.rs:786–800  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

784
785 #[test]
786 fn test_parse_pre_tool() {
787 let hook = make_hook();
788 let input = br#"{
789 "taskId": "tool-1",
790 "hookName": "PreToolUse",
791 "preToolUse": {
792 "tool": "write_to_file",
793 "parameters": {"path": "src/main.rs", "content": "fn main() {}"}
794 }
795 }"#;
796 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
797 assert_eq!(event.session_id, "tool-1");
798 assert_eq!(event.event_type, HookType::PreToolUse);
799 assert_eq!(event.tool_name.as_deref(), Some("write_to_file"));
800 }
801
802 #[test]
803 fn test_parse_pre_tool_snake_case_alias() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected