-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay21_test.go
43 lines (40 loc) · 1.11 KB
/
Day21_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import "testing"
func TestComputeDay21a(t *testing.T) {
type args struct {
input string
}
tests := []struct {
name string
args args
want int
}{
{"Day 21 part 1 example", args {"mxmxvkd kfcds sqjhc nhms (contains dairy, fish)\ntrh fvjkl sbzzf mxmxvkd (contains dairy)\nsqjhc fvjkl (contains soy)\nsqjhc mxmxvkd sbzzf (contains fish)"}, 5},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got, _ := ComputeDay21a(tt.args.input); got != tt.want {
t.Errorf("ComputeDay21a() = %v, want %v", got, tt.want)
}
})
}
}
func TestComputeDay21b(t *testing.T) {
type args struct {
input string
}
tests := []struct {
name string
args args
want string
}{
{"Day 21 part 1 example", args {"mxmxvkd kfcds sqjhc nhms (contains dairy, fish)\ntrh fvjkl sbzzf mxmxvkd (contains dairy)\nsqjhc fvjkl (contains soy)\nsqjhc mxmxvkd sbzzf (contains fish)"}, "mxmxvkd,sqjhc,fvjkl"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ComputeDay21b(tt.args.input); got != tt.want {
t.Errorf("ComputeDay21b() = %v, want %v", got, tt.want)
}
})
}
}