-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay7_test.go
60 lines (53 loc) · 1.15 KB
/
Day7_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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"io/ioutil"
"testing"
)
func TestComputeDay7a(t *testing.T) {
inputpath := "D:/Home/projects/adventcalendar/2020/inputs/day7-test.dat"
bytes, err := ioutil.ReadFile(inputpath)
if err != nil {
panic("No input file found")
}
type args struct {
input string
}
tests := []struct {
name string
args args
want int
}{
{"Day 8 example part 1", args{string(bytes)}, 4},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ComputeDay7a(tt.args.input); got != tt.want {
t.Errorf("ComputeDay7a() = %v, want %v", got, tt.want)
}
})
}
}
func TestComputeDay7b(t *testing.T) {
inputpath := "D:/Home/projects/adventcalendar/2020/inputs/day7-test.dat"
bytes, err := ioutil.ReadFile(inputpath)
if err != nil {
panic("No input file found")
}
type args struct {
input string
}
tests := []struct {
name string
args args
want int
}{
{"Day 8 example part 2", args{string(bytes)}, 32},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ComputeDay7b(tt.args.input); got != tt.want {
t.Errorf("ComputeDay7b() = %v, want %v", got, tt.want)
}
})
}
}