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

Function test_parse_session_end

atomic-agent/src/hooks/cursor.rs:908–917  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

906
907 #[test]
908 fn test_parse_session_end() {
909 let hook = make_hook();
910 let input =
911 br#"{"conversation_id": "conv-123", "session_id": "sess-456", "reason": "user_quit"}"#;
912 let event = hook.parse_event(HookType::SessionEnd, input).unwrap();
913 assert_eq!(event.session_id, "conv-123");
914 assert_eq!(event.event_type, HookType::SessionEnd);
915 let raw = event.raw_json.unwrap();
916 assert_eq!(raw["reason"], "user_quit");
917 }
918
919 #[test]
920 fn test_parse_session_end_with_duration() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected