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

Function test_parse_after_tool

atomic-agent/src/hooks/opencode.rs:825–840  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

823
824 #[test]
825 fn test_parse_after_tool() {
826 let hook = make_hook();
827 let input = br#"{
828 "session_id": "s1",
829 "tool_name": "bash",
830 "tool_call_id": "call-99",
831 "status": "completed",
832 "duration": 1500,
833 "modified_files": true
834 }"#;
835 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
836 assert_eq!(event.session_id, "s1");
837 assert_eq!(event.event_type, HookType::PostToolUse);
838 assert_eq!(event.tool_name.as_deref(), Some("bash"));
839 assert_eq!(event.tool_use_id.as_deref(), Some("call-99"));
840 }
841
842 // parse_event tests: error cases
843

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected