test: add unit test for p1 from paper calculation
This commit is contained in:
17
internal/2015/DaySix/code_test.go
Normal file
17
internal/2015/DaySix/code_test.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package daysix
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"turn on 0,0 through 999,999",
|
||||||
|
"toggle 0,0 through 999,0",
|
||||||
|
"turn off 499,499 through 500,500",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 998996
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user