2024-01-07 00:09:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-01-07 02:33:45 +00:00
|
|
|
"math/rand"
|
2024-01-07 00:09:47 +00:00
|
|
|
"testing"
|
2024-01-07 02:33:45 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2024-01-07 00:09:47 +00:00
|
|
|
)
|
|
|
|
|
2024-01-07 02:33:45 +00:00
|
|
|
func TestPlayRound(t *testing.T) {
|
|
|
|
|
|
|
|
entropy := rand.New(rand.NewSource(0xdeadbeef))
|
|
|
|
|
|
|
|
rr := NewRound(5, 4, entropy)
|
|
|
|
nextPlayer, scores := rr.Play(0)
|
|
|
|
|
|
|
|
assert.EqualValues(t, 0, nextPlayer)
|
|
|
|
assert.EqualValues(t, []int{0, 28, 6, 6}, scores)
|
2024-01-07 00:09:47 +00:00
|
|
|
}
|