adventofcode2017/16/16_test.go
2017-12-16 14:05:04 +00:00

37 lines
No EOL
523 B
Go

package main
import (
"testing"
)
var test = []string{"s1", "x3/4", "pe/b"}
func TestRun16(t *testing.T) {
i := ParseInstr(test)
input := "abcde"
v := Run16(input, i)
if v != "baedc" {
t.Error(
"For", test,
"expected baedc",
"got", v,
)
}
}
func TestRun1M(t *testing.T) {
i := ParseInstr(test)
input := "abcdefghijlmnop"
for x :=0; x<10000000; x++ {
input = Run16(input, i)
}
if input != "fghdijlmnopabce" {
t.Error(
"For", test,
"expected fghdijlmnopabce",
"got", input,
)
}
}