RC-5
This commit is contained in:
@@ -79,3 +79,26 @@ func TestGuessHotPathAndReroll(t *testing.T) {
|
||||
t.Fatalf("reroll not reset: %+v", g)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLotterySkipConsumesSequenceWithoutCountingAcceptedGuess(t *testing.T) {
|
||||
s := New()
|
||||
task := data.Task{ID: "lottery-task", PublicSeed: "seed", Revision: 1}
|
||||
s.InitGuess(task, "client", GuessState{})
|
||||
if err := s.CanSubmit(task, "client", 0, 0); err != nil {
|
||||
t.Fatalf("eligible guess rejected: %v", err)
|
||||
}
|
||||
next, err := s.SkipLottery(task, "client", 0, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if next != 1 {
|
||||
t.Fatalf("next seq = %d, want 1", next)
|
||||
}
|
||||
g, ok := s.Current(task, "client")
|
||||
if !ok {
|
||||
t.Fatal("missing runtime state")
|
||||
}
|
||||
if g.NextSeq != 1 || g.GuessCount != 0 || g.LastGuess.IsZero() {
|
||||
t.Fatalf("unexpected lottery skip state: %+v", g)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user