mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-16 20:52:02 +00:00
feat: promote accepted proposals from API
This commit is contained in:
@@ -10,7 +10,7 @@ func testFormation(t *testing.T, count int) MatchFormation {
|
||||
now := time.Unix(1000, 0)
|
||||
players := make([]Candidate, count)
|
||||
for i := range players {
|
||||
players[i] = Candidate{TicketID: string(rune('a' + i)), PlayerID: string(rune('p' + i)), Rating: 1500, EnqueuedAt: now, PredictedRTT: map[string]float64{"EU": 40}}
|
||||
players[i] = Candidate{TicketID: string(rune('a' + i)), PlayerID: string(rune('p' + i)), ProtocolVersion: 1, Rating: 1500, EnqueuedAt: now, PredictedRTT: map[string]float64{"EU": 40}}
|
||||
}
|
||||
selection, err := SelectCandidates(players[0], players[1:], count, now)
|
||||
if err != nil {
|
||||
@@ -31,6 +31,9 @@ func TestPrepareProposalBuildsCasualLineupBeforeCreatingProposal(t *testing.T) {
|
||||
if prepared.Proposal.Playlist != Casual || len(prepared.Proposal.Participants) != 2 || len(prepared.CasualLineup) != 6 {
|
||||
t.Fatalf("prepared casual proposal = %+v", prepared)
|
||||
}
|
||||
if prepared.Proposal.Region != "EU" || prepared.Proposal.Protocol != 1 || prepared.Proposal.Participants[0].Slot == prepared.Proposal.Participants[1].Slot || prepared.Proposal.Participants[0].Team == prepared.Proposal.Participants[1].Team {
|
||||
t.Fatalf("prepared proposal did not retain deterministic topology: %+v", prepared.Proposal)
|
||||
}
|
||||
humans := 0
|
||||
teams := map[int]bool{}
|
||||
for _, slot := range prepared.CasualLineup {
|
||||
|
||||
Reference in New Issue
Block a user