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

Function test_parse_after_tool

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected