Day 2 part 2.

This commit is contained in:
2017-12-10 16:52:00 -08:00
parent 8dc6e4e5f6
commit 86a286a2b1
3 changed files with 69 additions and 5 deletions

View File

@@ -2,12 +2,22 @@ package main
import "testing"
func TestChecksum(t *testing.T) {
func TestChecksum1(t *testing.T) {
var spreadsheet = `5 1 9 5
7 5 3
2 4 6 8`
want := 18
if got := checksum(spreadsheet); got != want {
t.Errorf("checksum() = %d; want %d", got, want)
if got := checksum1(spreadsheet); got != want {
t.Errorf("checksum1() = %d; want %d", got, want)
}
}
func TestChecksum2(t *testing.T) {
var spreadsheet = `5 9 2 8
9 4 7 3
3 8 6 5`
want := 9
if got := checksum2(spreadsheet); got != want {
t.Errorf("checksum2() = %d; want %d", got, want)
}
}