Files
aoc2020/seventeen/day_seventeen_test.go
James Griffin 93103bd18a Day 17: Part 1
Signed-off-by: James Griffin <james@unsupervised.ca>
2020-12-17 20:58:11 -04:00

52 lines
938 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.print()
p = simulate(p, 1)
p.print()
active := p.active()
if active != 12 {
t.Logf("Expected 11 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)
p.print()
active := p.active()
if active != 112 {
t.Logf("Expected 112 active after 6 rounds, found %d", active)
t.FailNow()
}
}