Files
AetherForge/server/internal/strategy/hospice_test.go
AetherForge d605ef4adb
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Add Strain Hospice for graceful low-win strain retirement.
Archive failed epidemiology strains to museum hospice with SQLite persistence, operator/AI/court triggers, breeding and graft guards, topology museum nodes, and Seer plus oath ledger accountability.
2026-06-07 09:26:39 -07:00

27 lines
724 B
Go

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")
}
}