package combat import "testing" // Regression: re-entering combat must release the previous mob, or that mob // stays "in combat" forever and no other player can attack it. func TestTrackerEnterReleasesPreviousMob(t *testing.T) { tr := NewTracker() tr.Enter("alice", "mobA") tr.Enter("alice", "mobB") if tr.IsMobInCombat("mobA") { t.Fatal("mobA still marked in combat after alice switched targets") } if !tr.IsMobInCombat("mobB") { t.Fatal("mobB not marked in combat") } tr.Leave("alice") if tr.IsMobInCombat("mobB") { t.Fatal("mobB still marked in combat after leave") } }