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

Function test_parse_post_tool_no_duration

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

Source from the content-addressed store, hash-verified

895
896 #[test]
897 fn test_parse_post_tool_no_duration() {
898 let hook = make_hook();
899 let input = br#"{
900 "taskId": "tool-7",
901 "postToolUse": {"tool": "read_file"}
902 }"#;
903 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
904 assert_eq!(event.tool_name.as_deref(), Some("read_file"));
905 // duration_ms should not be present in raw_json if not provided
906 let raw = event.raw_json.unwrap();
907 assert!(raw.get("duration_ms").is_none());
908 }
909
910 // ── parse_event tests: error cases ──────────────────────────────
911

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected