But Part 1 is gone now! Signed-off-by: James Griffin <james@unsupervised.ca>
51 lines
917 B
Go
51 lines
917 B
Go
package seventeen
|
|
|
|
import "testing"
|
|
|
|
func Test_dimension_init(t *testing.T) {
|
|
p := pocket{}
|
|
if err := p.initialize("sample.txt"); err != nil {
|
|
t.Logf(err.Error())
|
|
t.FailNow()
|
|
}
|
|
|
|
active := p.active()
|
|
if active != 5 {
|
|
t.Logf("Expected 5 active after 0 rounds, found %d", active)
|
|
t.FailNow()
|
|
}
|
|
}
|
|
|
|
func Test_dimension_simulate1(t *testing.T) {
|
|
p := pocket{}
|
|
if err := p.initialize("sample.txt"); err != nil {
|
|
t.Logf(err.Error())
|
|
t.FailNow()
|
|
}
|
|
|
|
p = simulate(p, 1)
|
|
p.print()
|
|
|
|
active := p.active()
|
|
if active != 29 {
|
|
t.Logf("Expected 29 active after 1 rounds, found %d", active)
|
|
t.FailNow()
|
|
}
|
|
}
|
|
|
|
func Test_dimension_simulate(t *testing.T) {
|
|
p := pocket{}
|
|
if err := p.initialize("sample.txt"); err != nil {
|
|
t.Logf(err.Error())
|
|
t.FailNow()
|
|
}
|
|
|
|
p = simulate(p, 6)
|
|
|
|
active := p.active()
|
|
if active != 848 {
|
|
t.Logf("Expected 848 active after 6 rounds, found %d", active)
|
|
t.FailNow()
|
|
}
|
|
}
|