Skip to content

Commit ce1f6d6

Browse files
haasonsaasclaude
andcommitted
test: 100% mutation coverage for agent loop — 7 new tests kill all 28 mutants
Strengthened TDD tests to catch remaining cargo-mutants survivors: - Verify correct tool dispatch by checking actual tool output (not just events) - MaxTokens stop_reason with ToolUse content exits without executing tools - LoopFinished event fields asserted for EndTurn, empty_tool_calls, and token_budget paths - Empty tool_calls and token budget exit paths verify iteration counts Result: 31 mutants tested, 28 caught, 3 unviable, 0 missed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 055afd6 commit ce1f6d6

3 files changed

Lines changed: 849 additions & 1 deletion

File tree

src/adapters/llm.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,34 @@ mod tests {
606606
assert_eq!(parsed, reason);
607607
}
608608
}
609+
610+
#[test]
611+
fn test_chat_role_display() {
612+
assert_eq!(ChatRole::User.to_string(), "user");
613+
assert_eq!(ChatRole::Assistant.to_string(), "assistant");
614+
// Ensure they produce different strings (catches mutation → same output)
615+
assert_ne!(ChatRole::User.to_string(), ChatRole::Assistant.to_string());
616+
}
617+
618+
#[test]
619+
fn test_default_supports_tools_is_false() {
620+
use async_trait::async_trait;
621+
622+
struct MinimalAdapter;
623+
#[async_trait]
624+
impl LLMAdapter for MinimalAdapter {
625+
async fn complete(&self, _request: LLMRequest) -> Result<LLMResponse> {
626+
unimplemented!()
627+
}
628+
fn model_name(&self) -> &str {
629+
"minimal"
630+
}
631+
}
632+
633+
let adapter = MinimalAdapter;
634+
assert!(
635+
!adapter.supports_tools(),
636+
"Default supports_tools() should return false, not true"
637+
);
638+
}
609639
}

0 commit comments

Comments
 (0)