hive-agent: pin classify_tool_result's own 120-char boundary
Mutation testing found this arm untested: classify_tool_result has its OWN `<= 120` deciding icon-vs-body, separate from the one in summarize_tool_result that picks the summary text. The existing case used 2 and 500 characters, so neither arm went near the boundary and moving it to 119 changed nothing. Verified the new test fails under exactly that mutation.
This commit is contained in:
parent
584db1e9c4
commit
91ab5f9d9c
1 changed files with 18 additions and 0 deletions
|
|
@ -1283,6 +1283,24 @@ mod tests {
|
|||
})
|
||||
}
|
||||
|
||||
/// `classify_tool_result` has its **own** `<= 120`, separate from the one
|
||||
/// in `summarize_tool_result`, and the two have to agree: one picks the
|
||||
/// summary text, the other picks icon-vs-body. A result that summarises as
|
||||
/// short but renders with a body is the inconsistency this pins.
|
||||
/// Added because mutation testing found the gap — the case below uses 2
|
||||
/// and 500 characters, so neither arm goes near the boundary and moving it
|
||||
/// to 119 changed nothing.
|
||||
#[test]
|
||||
fn the_icon_or_body_choice_turns_on_the_same_120_boundary() {
|
||||
let at = one(&tool_result(&"a".repeat(120), false, "t1"));
|
||||
assert_eq!(at.icon.as_deref(), Some("←"), "120 chars is still short");
|
||||
assert!(at.body.is_none());
|
||||
|
||||
let over = one(&tool_result(&"a".repeat(121), false, "t1"));
|
||||
assert!(over.icon.is_none(), "121 chars stops being short");
|
||||
assert_eq!(over.body.as_deref().map(str::len), Some(121));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_short_result_gets_an_icon_and_a_long_one_gets_a_body() {
|
||||
let short = one(&tool_result("ok", false, "t1"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue