summaryrefslogtreecommitdiff
path: root/test/turing.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/turing.go')
-rw-r--r--test/turing.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/turing.go b/test/turing.go
index 9d3f3a669..366982e67 100644
--- a/test/turing.go
+++ b/test/turing.go
@@ -25,6 +25,7 @@ func scan(dir int) {
}
func main() {
+ r := ""
for {
switch prog[pc] {
case '>':
@@ -36,7 +37,7 @@ func main() {
case '-':
a[p]--
case '.':
- print(string(a[p]))
+ r += string(a[p])
case '[':
if a[p] == 0 {
scan(1)
@@ -46,6 +47,9 @@ func main() {
scan(-1)
}
default:
+ if r != "Hello World!\n" {
+ panic(r)
+ }
return
}
pc++