This commit is contained in:
Ben Charlton 2017-12-16 14:05:04 +00:00
parent cccd9976df
commit ad8b760cb2
2 changed files with 178 additions and 0 deletions

37
16/16_test.go Normal file
View file

@ -0,0 +1,37 @@
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,
)
}
}