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

Function test_parse_user_prompt

atomic-agent/src/hooks/cline.rs:734–748  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

732
733 #[test]
734 fn test_parse_user_prompt() {
735 let hook = make_hook();
736 let input = br#"{
737 "taskId": "prompt-1",
738 "hookName": "UserPromptSubmit",
739 "userPromptSubmit": {"prompt": "Fix the auth bug in login.rs"}
740 }"#;
741 let event = hook.parse_event(HookType::TurnStart, input).unwrap();
742 assert_eq!(event.session_id, "prompt-1");
743 assert_eq!(event.event_type, HookType::TurnStart);
744 assert_eq!(
745 event.prompt.as_deref(),
746 Some("Fix the auth bug in login.rs")
747 );
748 }
749
750 #[test]
751 fn test_parse_user_prompt_snake_case_alias() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected