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

Function test_parse_after_tool

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

Source from the content-addressed store, hash-verified

941
942 #[test]
943 fn test_parse_after_tool() {
944 let hook = make_hook();
945 let input = br#"{
946 "session_id": "s1",
947 "tool_name": "bash",
948 "tool_call_id": "call-99",
949 "status": "completed",
950 "duration": 1500,
951 "modified_files": true
952 }"#;
953 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
954 assert_eq!(event.session_id, "s1");
955 assert_eq!(event.event_type, HookType::PostToolUse);
956 assert_eq!(event.tool_name.as_deref(), Some("bash"));
957 assert_eq!(event.tool_use_id.as_deref(), Some("call-99"));
958 }
959
960 // parse_event tests: error cases
961

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected