Runtest should fail on bad test data. Fix interop tests.
authorJoel Martin <github@martintribe.org>
Mon, 28 Jan 2019 16:27:41 +0000 (10:27 -0600)
committerJoel Martin <github@martintribe.org>
Mon, 28 Jan 2019 16:27:41 +0000 (10:27 -0600)
The interop tests weren't updated when regex support was added to
runtest for matching output data. This was causing a bunch of
implementations to silently fail while testing interop. Fix runtest.py
to fail on bad test data and fix 21 implementations with the old style
output matches.

22 files changed:
bash/tests/stepA_mal.mal
clojure/tests/stepA_mal.mal
coffee/tests/stepA_mal.mal
elisp/tests/stepA_mal.mal
fantom/tests/stepA_mal.mal
forth/tests/stepA_mal.mal
gnu-smalltalk/tests/stepA_mal.mal
io/tests/stepA_mal.mal
js/tests/stepA_mal.mal
logo/tests/stepA_mal.mal
lua/tests/stepA_mal.mal
make/tests/stepA_mal.mal
perl/tests/stepA_mal.mal
perl6/tests/stepA_mal.mal
php/tests/stepA_mal.mal
python/tests/stepA_mal.mal
rexx/tests/stepA_mal.mal
ruby/tests/stepA_mal.mal
runtest.py
scheme/tests/stepA_mal.mal
tcl/tests/stepA_mal.mal
yorick/tests/stepA_mal.mal

index bf3eabd..c121efa 100644 (file)
@@ -4,7 +4,7 @@
 ;=>"7"
 
 (sh* "echo >&2 hello")
-; hello
+;/hello
 ;=>""
 
 (sh* "foo=8; echo ${foo}")
index 4c7ec35..d77c8a2 100644 (file)
 ;=>{"abc" 123}
 
 (if clj (clj* "(prn \"foo\")") (js* "console.log('\"foo\"')"))
-; "foo"
+;/"foo"
 ;=>nil
 
-(if clj (clj* "(for [x [1 2 3]] (+ 1 x))") '(2 3 4))
+(if clj (clj* "(apply list (for [x [1 2 3]] (+ 1 x)))") '(2 3 4))
 ;=>(2 3 4)
 (if cljs (js* "[1,2,3].map(function(x) {return 1+x})") [2 3 4])
 ;=>[2 3 4]
index f785292..8669997 100644 (file)
@@ -10,7 +10,7 @@
 ;=>(7 8 9)
 
 (js* "console.log('hello');")
-; hello
+;/hello
 ;=>nil
 
 (js* "foo=8;")
index 8f6e9a3..c655af6 100644 (file)
@@ -13,7 +13,7 @@
 ;=>(1 2 3)
 
 (elisp-eval "(progn (princ \"Hello World!\n\") nil)")
-; Hello World!
+;/Hello World!
 ;=>nil
 
 (elisp-eval "(setq emacs-version-re (rx (+ digit) \".\" digit \".\" digit))")
index a8c37d8..29739c3 100644 (file)
@@ -19,7 +19,7 @@
 ;=>{"abc" 789}
 
 (fantom-eval "echo(\"hello\")")
-; hello
+;/hello
 ;=>nil
 
 (fantom-eval "[\"a\",\"b\",\"c\"].join(\" \") { \"X${it}Y\" }")
index c4a0e75..3d8db05 100644 (file)
@@ -6,7 +6,7 @@
 (. "greetings" 'MalString.)
 ;=>"greetings"
 (. "hello" 'type 'cr 'mal-nil)
-; hello
+;/hello
 ;=>nil
 
 ;; Interop on non-literals
 ;=>7
 (def! prn-chars (fn* (start count) (if (> count 0) (do (prn (. start 1 'MalString.)) (prn-chars (+ start 1) (- count 1))))))
 (let* (msg (string-parts "sketchy")) (prn-chars (first msg) (first (rest msg))))
-; "s"
-; "k"
-; "e"
-; "t"
-; "c"
-; "h"
-; "y"
+;/"s"
+;/"k"
+;/"e"
+;/"t"
+;/"c"
+;/"h"
+;/"y"
 ;=>nil
index 32221a4..f8ff39f 100644 (file)
@@ -8,4 +8,4 @@
 ;=>"a b c"
 
 (gst-eval "'Hello World!' displayNl")
-; Hello World!
+;/Hello World!
index 4a07a60..5b0f5dc 100644 (file)
@@ -19,7 +19,7 @@
 ;=>{"abc" 789}
 
 (io-eval "\"hello\" println")
-; hello
+;/hello
 ;=>"hello"
 
 (io-eval "Lobby foo := 8")
index 4502bff..5412768 100644 (file)
@@ -10,7 +10,7 @@
 ;=>(7 8 9)
 
 (js-eval "console.log('hello');")
-; hello
+;/hello
 ;=>nil
 
 (js-eval "foo=8;")
@@ -27,7 +27,7 @@
 ;=>60
 
 (. "console.log" "abc" 123 '(4 5 6) {"kk" "vv"} (= 1 1) nil)
-; abc 123 \[ 4, 5, 6 \] \{ kk: 'vv' \} true null
+;/abc 123 \[ 4, 5, 6 \] \{ kk: 'vv' \} true null
 ;=>nil
 
 (js-eval "myobj = { v: 10, myfunc: function(a,b,c) { return a * b * c * this.v; } }")
index 904b7db..9175626 100644 (file)
@@ -16,7 +16,7 @@
 ;=>false
 
 (logo-eval "print [hello world]")
-; hello world
+;/hello world
 ;=>nil
 
 (logo-eval "make \"foo 8")
index b52a902..70a1423 100644 (file)
@@ -24,7 +24,7 @@
 ;=>{"abc" 789}
 
 (lua-eval "print('hello')")
-; hello
+;/hello
 ;=>nil
 
 (lua-eval "(function() foo = 8 end)()")
index 768a929..ed5551c 100644 (file)
@@ -4,7 +4,7 @@
 ;=>"7"
 
 (make* "$(info foo)")
-; foo
+;/foo
 ;=>""
 
 (make* "$(eval foo := 8)")
index 1335be4..7f5abe7 100644 (file)
@@ -18,5 +18,5 @@
 ;; Testing eval of print statement
 
 (pl* "print 'hello\n';")
-; hello
+;/hello
 ;=>1
index a1b4a38..0a586b4 100644 (file)
@@ -34,7 +34,7 @@
 ;=>nil
 
 (perl6-eval "say 'hello' ")
-; hello
+;/hello
 ;=>true
 
 (perl6-eval "sub { my $foo = 8 }()")
index 80d9a0b..de459cd 100644 (file)
@@ -13,7 +13,7 @@
 ;=>{"abc" 789}
 
 (php* "print \"hello\n\";")
-; hello
+;/hello
 ;=>nil
 
 (php* "global $foo; $foo=8;")
index dfe0510..7985192 100644 (file)
@@ -14,7 +14,7 @@
 
 ;; Testing Python statements
 (py!* "print('hello')")
-; hello
+;/hello
 ;=>nil
 
 (py!* "foo = 19 % 4")
index cc05df4..21a3f86 100644 (file)
@@ -13,7 +13,7 @@
 ;=>"FE"
 
 (rexx-eval "say 'hello' 12.34 upper('rexx')" nil)
-; hello 12.34 REXX
+;/hello 12.34 REXX
 ;=>nil
 
 (rexx-eval "foo = 8" "foo + 3")
index 2d7efb8..79cca19 100644 (file)
@@ -13,7 +13,7 @@
 ;=>{"abc" 789}
 
 (rb* "print 'hello\n'")
-; hello
+;/hello
 ;=>nil
 
 (rb* "$foo=8;")
index 8953a10..f8779c7 100755 (executable)
@@ -204,8 +204,7 @@ class TestReader:
                     return True
                 continue
             elif line[0:1] == ";":         # unexpected comment
-                log("Test data error at line %d:\n%s" % (self.line_num, line))
-                return None
+                raise Exception("Test data error at line %d:\n%s" % (self.line_num, line))
             self.form = line   # the line is a form to send
 
             # Now find the output and return value
index 85eb6f0..4ba3b9f 100644 (file)
@@ -3,8 +3,9 @@
 (scm-eval "(+ 1 1)")
 ;=>2
 
-(scm-eval "(begin (display \"Hello World!\") (newline))")
-; "Hello World!"
+(scm-eval "(begin (display \"Hello World!\") (newline) 7)")
+;/Hello World!
+;=>7
 
 (scm-eval "(string->list \"MAL\")")
 ;=>("M" "A" "L")
index 57bdd18..a53ddab 100644 (file)
@@ -13,7 +13,7 @@
 ;=>"a b c d e f g"
 
 (tcl* "puts \"hello [expr {5 + 6}] world\"")
-; hello 11 world
+;/hello 11 world
 ;=>""
 
 (tcl* "set ::foo 8")
index 8c2229a..76bc44e 100644 (file)
@@ -16,7 +16,7 @@
 ;=>(7 8 9)
 
 (yorick-eval "write, format=\"%s-%d\\x0A\", \"hello\", 1234; return nil;")
-; hello-1234
+;/hello-1234
 ;=>nil
 
 (yorick-eval "extern my_global_var; my_global_var = 8; return nil;")