mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-02 18:29:39 +02:00
36 lines
612 B
Go
36 lines
612 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/alexchao26/advent-of-code-go/util"
|
|
)
|
|
|
|
var example = `cpy 2 a
|
|
tgl a
|
|
tgl a
|
|
tgl a
|
|
cpy 1 a
|
|
dec a
|
|
dec a`
|
|
|
|
func Test_part1(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
input string
|
|
part int
|
|
want int
|
|
}{
|
|
{"example", example, 1, 3},
|
|
{"actual", util.ReadFile("input.txt"), 1, 11893},
|
|
{"actual", util.ReadFile("input.txt"), 2, 479008453},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := assemblyComputer(tt.input, tt.part); got != tt.want {
|
|
t.Errorf("assemblyComputer() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|