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

Function test_parse_task_start

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

Source from the content-addressed store, hash-verified

584
585 #[test]
586 fn test_parse_task_start() {
587 let hook = make_hook();
588 let input = br#"{
589 "taskId": "abc123",
590 "hookName": "TaskStart",
591 "timestamp": "1736654400000",
592 "workspaceRoots": ["/path/to/project"],
593 "model": {"provider": "openrouter", "slug": "anthropic/claude-sonnet-4.5"},
594 "taskStart": {"task": "Add authentication to the API"}
595 }"#;
596 let event = hook.parse_event(HookType::SessionStart, input).unwrap();
597 assert_eq!(event.session_id, "abc123");
598 assert_eq!(event.event_type, HookType::SessionStart);
599 assert_eq!(
600 event.prompt.as_deref(),
601 Some("Add authentication to the API")
602 );
603 }
604
605 #[test]
606 fn test_parse_task_start_with_model_info() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected