Files
aoc2020/twentyfour/day_twentyfour_test.go
James Griffin ed12b06814 Day 24: Part 1
Signed-off-by: James Griffin <james@unsupervised.ca>
2020-12-24 11:39:34 -04:00

41 lines
730 B
Go

package twentyfour
import "testing"
func Test_load_instructions(t *testing.T) {
l := lobby{}
l.load("sample.txt")
if len(l.instructions) != 20 {
t.Logf("Expected 20 instructions, found %d", len(l.instructions))
t.Fail()
}
}
func Test_layout_tiles(t *testing.T) {
l := lobby{}
l.load("sample.txt")
if len(l.instructions) != 20 {
t.Logf("Expected 20 instructions, found %d", len(l.instructions))
t.Fail()
}
l.layout()
black, white := l.countTiles()
if black + white != 15 {
t.Logf("Expected 15 tiles, got %d", black+white)
t.Fail()
}
if black != 10 {
t.Logf("Expected 10 black tiles, got %d", black)
t.Fail()
}
if white != 5 {
t.Logf("Expected 5 white tiles, got %d", white)
t.Fail()
}
}