test: add unit test for part one
This commit is contained in:
16
internal/2015/DayFifteen/code_test.go
Normal file
16
internal/2015/DayFifteen/code_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package dayfifteen
|
||||
|
||||
import "testing"
|
||||
|
||||
var testInput = []string{
|
||||
"Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8",
|
||||
"Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3",
|
||||
}
|
||||
|
||||
func TestPartOne(t *testing.T) {
|
||||
expected := 62842880
|
||||
got := PartOne(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user