diff --git a/internal/2022/DayOne/code_test.go b/internal/2022/DayOne/code_test.go new file mode 100644 index 0000000..91c2ffd --- /dev/null +++ b/internal/2022/DayOne/code_test.go @@ -0,0 +1,36 @@ +package dayone + +import "testing" + +var testInput = []string{ + "1000", + "2000", + "3000", + "", + "4000", + "", + "5000", + "6000", + "", + "7000", + "8000", + "9000", + "", + "10000", +} + +func TestPartOne(t *testing.T) { + expected := 24000 + got := PartOne(testInput) + if got != expected { + t.Errorf("PartOne() = %d, want %d", got, expected) + } +} + +func TestPartTwo(t *testing.T) { + expected := 45000 + got := PartTwo(testInput) + if got != expected { + t.Errorf("PartTwo() = %d, want %d", got, expected) + } +}