2015-day11: incrementing strings until validated

This commit is contained in:
alexchao26
2020-12-26 16:13:17 -05:00
parent 4c15ca1606
commit b36d034679
2 changed files with 108 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package main
import (
"testing"
"github.com/alexchao26/advent-of-code-go/util"
)
func Test_passwordIncrementing(t *testing.T) {
tests := []struct {
name string
input string
part int
want string
}{
{"part1 actual", util.ReadFile("input.txt"), 1, "hxbxxyzz"},
{"part2 actual", util.ReadFile("input.txt"), 2, "hxcaabcc"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := passwordIncrementing(tt.input, tt.part); got != tt.want {
t.Errorf("passwordIncrementing() = %v, want %v", got, tt.want)
}
})
}
}