test: add unit test for part one
This commit is contained in:
20
internal/2022/DayFour/code_test.go
Normal file
20
internal/2022/DayFour/code_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package dayfour
|
||||
|
||||
import "testing"
|
||||
|
||||
var testInput = []string{
|
||||
"2-4,6-8",
|
||||
"2-3,4-5",
|
||||
"5-7,7-9",
|
||||
"2-8,3-7",
|
||||
"6-6,4-6",
|
||||
"2-6,4-8",
|
||||
}
|
||||
|
||||
func TestPartOne(t *testing.T) {
|
||||
expected := 2
|
||||
got := PartOne(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user