33 lines
527 B
Go
33 lines
527 B
Go
package dayfour
|
|
|
|
import "testing"
|
|
|
|
var testInput = []string{
|
|
"..@@.@@@@.",
|
|
"@@@.@.@.@@",
|
|
"@@@@@.@.@@",
|
|
"@.@@@@..@.",
|
|
"@@.@@@@.@@",
|
|
".@@@@@@@.@",
|
|
".@.@.@.@@@",
|
|
"@.@@@.@@@@",
|
|
".@@@@@@@@.",
|
|
"@.@.@@@.@.",
|
|
}
|
|
|
|
func TestPartOne(t *testing.T) {
|
|
expected := 13
|
|
got := PartOne(testInput)
|
|
if got != expected {
|
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
|
}
|
|
}
|
|
|
|
func TestPartTwo(t *testing.T) {
|
|
expected := 43
|
|
got := PartTwo(testInput)
|
|
if got != expected {
|
|
t.Errorf("PartTwo() = %d, want %d", got, expected)
|
|
}
|
|
}
|