test: add unit test for part one
This commit is contained in:
19
internal/2017/DayFive/code_test.go
Normal file
19
internal/2017/DayFive/code_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package dayfive
|
||||
|
||||
import "testing"
|
||||
|
||||
var testInput = []int{
|
||||
0,
|
||||
3,
|
||||
0,
|
||||
1,
|
||||
-3,
|
||||
}
|
||||
|
||||
func TestPartOne(t *testing.T) {
|
||||
expected := 5
|
||||
got := PartOne(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user