1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package main
import (
"testing"
"mm/internal/detector"
"mm/internal/ui"
)
func TestLoopStruggleWarnsThenStops(t *testing.T) {
cases := map[detector.Loop]ui.Struggle{
{Tool: "bash", Repeats: 4}: {Label: "loop: bash ×4"},
{Tool: "edit_file", Repeats: 6, Stuck: true}: {Severe: true, Label: "stuck: edit_file ×6"},
{Tool: "bash", Repeats: 3, Failing: true}: {Label: "failing: 3 tool calls in a row"},
}
for loop, want := range cases {
if got := loopStruggle(loop); got != want {
t.Errorf("loopStruggle(%+v) = %+v, want %+v", loop, got, want)
}
}
}
|