()
| 310 | |
| 311 | #[test] |
| 312 | fn test_parse_line_assistant() { |
| 313 | let line = r#"{"type":"assistant","message":{"id":"msg_01abc","model":"claude-opus-4-6","role":"assistant","usage":{"input_tokens":1000,"output_tokens":200,"cache_creation_input_tokens":500,"cache_read_input_tokens":800},"content":[{"type":"tool_use","name":"Edit","input":{"file_path":"test.rs"}}]},"timestamp":"2026-04-14T10:00:00.000Z"}"#; |
| 314 | let turn = parse_line(line, "proj", "sess"); |
| 315 | assert!(turn.is_some()); |
| 316 | let t = turn.unwrap(); |
| 317 | assert_eq!(t.message_id, "msg_01abc"); |
| 318 | assert_eq!(t.model, "claude-opus-4-6"); |
| 319 | assert_eq!(t.input_tokens, 1000); |
| 320 | assert_eq!(t.output_tokens, 200); |
| 321 | assert_eq!(t.cache_write_tokens, 500); |
| 322 | assert_eq!(t.cache_read_tokens, 800); |
| 323 | assert_eq!(t.category, "coding"); |
| 324 | assert_eq!(t.tool_names, "Edit"); |
| 325 | assert!(t.cost_usd > 0.0); |
| 326 | } |
| 327 | |
| 328 | #[test] |
| 329 | fn test_parse_line_user_skipped() { |
nothing calls this directly
no test coverage detected