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

Function test_parse_session_end

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

Source from the content-addressed store, hash-verified

909
910 #[test]
911 fn test_parse_session_end() {
912 let hook = make_hook();
913 let input =
914 br#"{"conversation_id": "conv-123", "session_id": "sess-456", "reason": "user_quit"}"#;
915 let event = hook.parse_event(HookType::SessionEnd, input).unwrap();
916 assert_eq!(event.session_id, "conv-123");
917 assert_eq!(event.event_type, HookType::SessionEnd);
918 let raw = event.raw_json.unwrap();
919 assert_eq!(raw["reason"], "user_quit");
920 }
921
922 #[test]
923 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