2016-day14: more md5 stuff

This commit is contained in:
alexchao26
2020-12-23 22:21:03 -05:00
parent 64c9b6d466
commit 883f71fda3
2 changed files with 96 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"testing"
"github.com/alexchao26/advent-of-code-go/util"
)
func Test_part1(t *testing.T) {
tests := []struct {
name string
input string
part int
want int
}{
{"example_part1", "abc", 1, 22728},
{"actual_part1", util.ReadFile("input.txt"), 1, 23769},
{"example_part2", "abc", 2, 22551},
{"actual_part2", util.ReadFile("input.txt"), 2, 20606},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := oneTimePad(tt.input, tt.part); got != tt.want {
t.Errorf("part1() = %v, want %v", got, tt.want)
}
})
}
}