test: add unit tests for p1/p2
This commit is contained in:
25
internal/2018/DayThree/code_test.go
Normal file
25
internal/2018/DayThree/code_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package daythree
|
||||
|
||||
import "testing"
|
||||
|
||||
var testInput = []string{
|
||||
"#1 @ 1,3: 4x4",
|
||||
"#2 @ 3,1: 4x4",
|
||||
"#3 @ 5,5: 2x2",
|
||||
}
|
||||
|
||||
func TestPartOne(t *testing.T) {
|
||||
expected := 4
|
||||
got := PartOne(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPartTwo(t *testing.T) {
|
||||
expected := 3
|
||||
got := PartTwo(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartTwo() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user