()
| 1211 | |
| 1212 | #[test] |
| 1213 | fn test_turn_event_builder_chain() { |
| 1214 | let event = TurnEvent::new("sess-1", HookType::TurnStart) |
| 1215 | .with_prompt("Fix the bug") |
| 1216 | .with_transcript_path("/tmp/transcript.jsonl") |
| 1217 | .with_tool_name("Edit") |
| 1218 | .with_tool_use_id("tu-123") |
| 1219 | .with_raw_json(serde_json::json!({"session_id": "sess-1"})); |
| 1220 | |
| 1221 | assert_eq!(event.prompt.as_deref(), Some("Fix the bug")); |
| 1222 | assert_eq!( |
| 1223 | event.transcript_path.as_deref(), |
| 1224 | Some(std::path::Path::new("/tmp/transcript.jsonl")) |
| 1225 | ); |
| 1226 | assert_eq!(event.tool_name.as_deref(), Some("Edit")); |
| 1227 | assert_eq!(event.tool_use_id.as_deref(), Some("tu-123")); |
| 1228 | assert!(event.raw_json.is_some()); |
| 1229 | } |
| 1230 | |
| 1231 | #[test] |
| 1232 | fn test_turn_event_has_prompt() { |
nothing calls this directly
no test coverage detected