Files
aoc2020/eleven/day_eleven_test.go
James Griffin 6029eed213 Day 11: Part 1 and 2
It isn’t pretty but it works

Signed-off-by: James Griffin <james.griffin-allwood@agilebits.com>
2020-12-11 11:54:36 -04:00

40 lines
711 B
Go

package eleven
import "testing"
func Test_seat_load(t *testing.T) {
w := waitingRoom("sample.txt")
if w.width != 10 {
t.Logf("Expected row width of 10, got %d", w.width)
t.FailNow()
}
if w.rows != 10 {
t.Logf("Expected 10 rows, got %d", w.rows)
t.FailNow()
}
}
func Test_seating_stabilization(t *testing.T) {
w := waitingRoom("sample.txt")
occupied := w.simulate(false)
if occupied != 37 {
t.Logf("Expected 37 occupied seats, found %d", occupied)
t.FailNow()
}
}
func Test_visible_seating_stabilization(t *testing.T) {
w := waitingRoom("sample.txt")
occupied := w.simulate(true)
if occupied != 26 {
t.Logf("Expected 26 occupied seats, found %d", occupied)
t.FailNow()
}
}