aoc2024/day-22/internal/randomiser/randomiser_internal_test.go

20 lines
341 B
Go
Raw Permalink Normal View History

2024-12-22 16:54:03 +00:00
package randomiser
import "testing"
func TestRandomiserMix(t *testing.T) {
r := New(42)
r.mix(15)
if r.secret != 37 {
2024-12-22 22:00:38 +00:00
t.Errorf("r.secret: got = %d want = 37", r.secret)
2024-12-22 16:54:03 +00:00
}
}
func TestRandomiserPrune(t *testing.T) {
r := New(10e7)
r.prune()
if r.secret != 16113920 {
t.Errorf("r.secret: got = %d want = 16113920", r.secret)
}
}