MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_parse_line_assistant

Function test_parse_line_assistant

src/accounting/parser.rs:312–326  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

parse_lineFunction · 0.85

Tested by

no test coverage detected