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

Function test_parse_after_tool

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

Source from the content-addressed store, hash-verified

856
857 #[test]
858 fn test_parse_after_tool() {
859 let hook = make_hook();
860 let input = br#"{
861 "session_id": "s1",
862 "tool_name": "bash",
863 "tool_call_id": "call-99",
864 "status": "completed",
865 "duration": 1500,
866 "modified_files": true
867 }"#;
868 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
869 assert_eq!(event.session_id, "s1");
870 assert_eq!(event.event_type, HookType::PostToolUse);
871 assert_eq!(event.tool_name.as_deref(), Some("bash"));
872 assert_eq!(event.tool_use_id.as_deref(), Some("call-99"));
873 }
874
875 // parse_event tests: error cases
876

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected