package strategy import "testing" func TestShouldAutoRetireStrain(t *testing.T) { if !ShouldAutoRetireStrain(1, 9, 0.15, 5) { t.Fatal("10% win rate with 10 attempts should retire at 15% threshold") } if ShouldAutoRetireStrain(1, 3, 0.15, 5) { t.Fatal("min attempts not met") } if StrainWinRate(0, 0) != 1.0 { t.Fatalf("empty stats should be 1.0, got %v", StrainWinRate(0, 0)) } } func TestLaneInHospice(t *testing.T) { strain := StrainFromSpreadLane("winrm") hospice := map[string]bool{strain: true} if !LaneInHospice("winrm", hospice) { t.Fatalf("winrm strain %s should be in hospice", strain) } if LaneInHospice("docker", hospice) { t.Fatal("docker lane should not match winrm hospice entry") } }