Files
advent-of-code-go/2017/day09/main_test.go
T
2020-12-14 20:20:17 -05:00

31 lines
704 B
Go

package main
import (
"testing"
"github.com/alexchao26/advent-of-code-go/util"
)
func Test_streamProcessing(t *testing.T) {
tests := []struct {
name string
input string
part int
want int
}{
{"part1_example 1", "{}", 1, 1},
{"part1_example 2", "{{}}", 1, 3},
{"part1_example 1", "{{}, {}}", 1, 5},
{"part1_example 1", "{{},<aksdljfsd!<> {}}", 1, 5},
{"part1_actual", util.ReadFile("input.txt"), 1, 16021},
{"part2_actual", util.ReadFile("input.txt"), 2, 7685},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := streamProcessing(tt.input, tt.part); got != tt.want {
t.Errorf("streamProcessing() = %v, want %v", got, tt.want)
}
})
}
}