Skip to content

Commit 18f0ec2

Browse files
committed
Runtest should fail on bad test data. Fix interop tests.
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.
1 parent 4aa0ebd commit 18f0ec2

File tree

22 files changed

+33
-33
lines changed

22 files changed

+33
-33
lines changed

bash/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
;=>"7"
55

66
(sh* "echo >&2 hello")
7-
; hello
7+
;/hello
88
;=>""
99

1010
(sh* "foo=8; echo ${foo}")

clojure/tests/stepA_mal.mal

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
;=>{"abc" 123}
1414

1515
(if clj (clj* "(prn \"foo\")") (js* "console.log('\"foo\"')"))
16-
; "foo"
16+
;/"foo"
1717
;=>nil
1818

19-
(if clj (clj* "(for [x [1 2 3]] (+ 1 x))") '(2 3 4))
19+
(if clj (clj* "(apply list (for [x [1 2 3]] (+ 1 x)))") '(2 3 4))
2020
;=>(2 3 4)
2121
(if cljs (js* "[1,2,3].map(function(x) {return 1+x})") [2 3 4])
2222
;=>[2 3 4]

coffee/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
;=>(7 8 9)
1111

1212
(js* "console.log('hello');")
13-
; hello
13+
;/hello
1414
;=>nil
1515

1616
(js* "foo=8;")

elisp/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;=>(1 2 3)
1414

1515
(elisp-eval "(progn (princ \"Hello World!\n\") nil)")
16-
; Hello World!
16+
;/Hello World!
1717
;=>nil
1818

1919
(elisp-eval "(setq emacs-version-re (rx (+ digit) \".\" digit \".\" digit))")

fantom/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
;=>{"abc" 789}
2020

2121
(fantom-eval "echo(\"hello\")")
22-
; hello
22+
;/hello
2323
;=>nil
2424

2525
(fantom-eval "[\"a\",\"b\",\"c\"].join(\" \") { \"X${it}Y\" }")

forth/tests/stepA_mal.mal

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(. "greetings" 'MalString.)
77
;=>"greetings"
88
(. "hello" 'type 'cr 'mal-nil)
9-
; hello
9+
;/hello
1010
;=>nil
1111

1212
;; Interop on non-literals
@@ -31,11 +31,11 @@
3131
;=>7
3232
(def! prn-chars (fn* (start count) (if (> count 0) (do (prn (. start 1 'MalString.)) (prn-chars (+ start 1) (- count 1))))))
3333
(let* (msg (string-parts "sketchy")) (prn-chars (first msg) (first (rest msg))))
34-
; "s"
35-
; "k"
36-
; "e"
37-
; "t"
38-
; "c"
39-
; "h"
40-
; "y"
34+
;/"s"
35+
;/"k"
36+
;/"e"
37+
;/"t"
38+
;/"c"
39+
;/"h"
40+
;/"y"
4141
;=>nil

gnu-smalltalk/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
;=>"a b c"
99

1010
(gst-eval "'Hello World!' displayNl")
11-
; Hello World!
11+
;/Hello World!

io/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
;=>{"abc" 789}
2020

2121
(io-eval "\"hello\" println")
22-
; hello
22+
;/hello
2323
;=>"hello"
2424

2525
(io-eval "Lobby foo := 8")

js/tests/stepA_mal.mal

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
;=>(7 8 9)
1111

1212
(js-eval "console.log('hello');")
13-
; hello
13+
;/hello
1414
;=>nil
1515

1616
(js-eval "foo=8;")
@@ -27,7 +27,7 @@
2727
;=>60
2828

2929
(. "console.log" "abc" 123 '(4 5 6) {"kk" "vv"} (= 1 1) nil)
30-
; abc 123 \[ 4, 5, 6 \] \{ kk: 'vv' \} true null
30+
;/abc 123 \[ 4, 5, 6 \] \{ kk: 'vv' \} true null
3131
;=>nil
3232

3333
(js-eval "myobj = { v: 10, myfunc: function(a,b,c) { return a * b * c * this.v; } }")

logo/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
;=>false
1717

1818
(logo-eval "print [hello world]")
19-
; hello world
19+
;/hello world
2020
;=>nil
2121

2222
(logo-eval "make \"foo 8")

lua/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
;=>{"abc" 789}
2525

2626
(lua-eval "print('hello')")
27-
; hello
27+
;/hello
2828
;=>nil
2929

3030
(lua-eval "(function() foo = 8 end)()")

make/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
;=>"7"
55

66
(make* "$(info foo)")
7-
; foo
7+
;/foo
88
;=>""
99

1010
(make* "$(eval foo := 8)")

perl/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
;; Testing eval of print statement
1919

2020
(pl* "print 'hello\n';")
21-
; hello
21+
;/hello
2222
;=>1

perl6/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
;=>nil
3535

3636
(perl6-eval "say 'hello' ")
37-
; hello
37+
;/hello
3838
;=>true
3939

4040
(perl6-eval "sub { my $foo = 8 }()")

php/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;=>{"abc" 789}
1414

1515
(php* "print \"hello\n\";")
16-
; hello
16+
;/hello
1717
;=>nil
1818

1919
(php* "global $foo; $foo=8;")

python/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
;; Testing Python statements
1616
(py!* "print('hello')")
17-
; hello
17+
;/hello
1818
;=>nil
1919

2020
(py!* "foo = 19 % 4")

rexx/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;=>"FE"
1414

1515
(rexx-eval "say 'hello' 12.34 upper('rexx')" nil)
16-
; hello 12.34 REXX
16+
;/hello 12.34 REXX
1717
;=>nil
1818

1919
(rexx-eval "foo = 8" "foo + 3")

ruby/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;=>{"abc" 789}
1414

1515
(rb* "print 'hello\n'")
16-
; hello
16+
;/hello
1717
;=>nil
1818

1919
(rb* "$foo=8;")

runtest.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ def next(self):
204204
return True
205205
continue
206206
elif line[0:1] == ";": # unexpected comment
207-
log("Test data error at line %d:\n%s" % (self.line_num, line))
208-
return None
207+
raise Exception("Test data error at line %d:\n%s" % (self.line_num, line))
209208
self.form = line # the line is a form to send
210209

211210
# Now find the output and return value

scheme/tests/stepA_mal.mal

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
(scm-eval "(+ 1 1)")
44
;=>2
55

6-
(scm-eval "(begin (display \"Hello World!\") (newline))")
7-
; "Hello World!"
6+
(scm-eval "(begin (display \"Hello World!\") (newline) 7)")
7+
;/Hello World!
8+
;=>7
89

910
(scm-eval "(string->list \"MAL\")")
1011
;=>("M" "A" "L")

tcl/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;=>"a b c d e f g"
1414

1515
(tcl* "puts \"hello [expr {5 + 6}] world\"")
16-
; hello 11 world
16+
;/hello 11 world
1717
;=>""
1818

1919
(tcl* "set ::foo 8")

yorick/tests/stepA_mal.mal

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
;=>(7 8 9)
1717

1818
(yorick-eval "write, format=\"%s-%d\\x0A\", \"hello\", 1234; return nil;")
19-
; hello-1234
19+
;/hello-1234
2020
;=>nil
2121

2222
(yorick-eval "extern my_global_var; my_global_var = 8; return nil;")

0 commit comments

Comments
 (0)