-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay8_test.go
More file actions
43 lines (40 loc) · 941 Bytes
/
Day8_test.go
File metadata and controls
43 lines (40 loc) · 941 Bytes
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 TestComputeDay8a(t *testing.T) {
type args struct {
input string
}
tests := []struct {
name string
args args
want int
}{
{"Day8 - Sample - Part 1", args{"nop +0\nacc +1\njmp +4\nacc +3\njmp -3\nacc -99\nacc +1\njmp -4\nacc +6"}, 5},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ComputeDay8a(tt.args.input); got != tt.want {
t.Errorf("ComputeDay8a() = %v, want %v", got, tt.want)
}
})
}
}
func TestComputeDay8b(t *testing.T) {
type args struct {
input string
}
tests := []struct {
name string
args args
want int
}{
{"Day8 - Sample - Part 2", args{"nop +0\nacc +1\njmp +4\nacc +3\njmp -3\nacc -99\nacc +1\njmp -4\nacc +6"}, 8},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ComputeDay8b(tt.args.input); got != tt.want {
t.Errorf("ComputeDay8a() = %v, want %v", got, tt.want)
}
})
}
}