()
| 821 | |
| 822 | #[test] |
| 823 | fn test_turn_event_builder_chain() { |
| 824 | let event = TurnEvent::new("sess-1", HookType::TurnStart) |
| 825 | .with_prompt("Fix the bug") |
| 826 | .with_transcript_path("/tmp/transcript.jsonl") |
| 827 | .with_tool_name("Edit") |
| 828 | .with_tool_use_id("tu-123") |
| 829 | .with_raw_json(serde_json::json!({"session_id": "sess-1"})); |
| 830 | |
| 831 | assert_eq!(event.prompt.as_deref(), Some("Fix the bug")); |
| 832 | assert_eq!( |
| 833 | event.transcript_path.as_deref(), |
| 834 | Some(std::path::Path::new("/tmp/transcript.jsonl")) |
| 835 | ); |
| 836 | assert_eq!(event.tool_name.as_deref(), Some("Edit")); |
| 837 | assert_eq!(event.tool_use_id.as_deref(), Some("tu-123")); |
| 838 | assert!(event.raw_json.is_some()); |
| 839 | } |
| 840 | |
| 841 | #[test] |
| 842 | fn test_turn_event_has_prompt() { |
nothing calls this directly
no test coverage detected