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

Function test_parse_session_end

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

Source from the content-addressed store, hash-verified

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