change test framework to use files for in and out (s-exp)

This commit is contained in:
Torsten Ruger
2015-09-18 21:55:02 +03:00
parent 396a843a5e
commit 22e3c59674
80 changed files with 946 additions and 13 deletions

View File

@ -0,0 +1,7 @@
module Opers
abba = 5
end
-- -- --
s(:list, [s(:module, "Opers", [s(:assign,
s(:name, "abba"),
s(:int, 5))])])

View File

@ -0,0 +1,11 @@
module Foo
class Bar
funcall(3 , var)
end
end
-- -- --
s(:list, [s(:module, "Foo", [s(:class, "Bar", nil, [s(:call,
s(:name, "funcall"),
s(:arguments,
s(:int, 3),
s(:name, "var")))])])])

View File

@ -0,0 +1,19 @@
module Soho
ofthen(3 , var)
int ofthen(int n,ref m )
return 44
end
end
-- -- --
s(:list, [s(:module, "Soho", [s(:call,
s(:name, "ofthen"),
s(:arguments,
s(:int, 3),
s(:name, "var"))), s(:function, :int,
s(:name, "ofthen"),
s(:parameters,
s(:field, :int, :n),
s(:field, :ref, :m)),
s(:expressions,
s(:return,
s(:int, 44))))])])

View File

@ -0,0 +1,25 @@
module Foo
ref ofthen(int n)
if(0)
isit = 42
else
maybenot = 667
end
end
end
-- -- --
s(:list, [s(:module, "Foo", [s(:function, :ref,
s(:name, "ofthen"),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:int, 0)),
s(:if_true,
s(:assign,
s(:name, "isit"),
s(:int, 42))),
s(:if_false, [s(:assign,
s(:name, "maybenot"),
s(:int, 667))]))))])])

View File

@ -0,0 +1,20 @@
module Opers
int foo(int x)
int abba = 5
return abba + 5
end
end
-- -- --
s(:list, [s(:module, "Opers", [s(:function, :int,
s(:name, "foo"),
s(:parameters,
s(:field, :int, :x)),
s(:expressions,
s(:name, "int"),
s(:assign,
s(:name, "abba"),
s(:int, 5)),
s(:return,
s(:operator, "+",
s(:name, "abba"),
s(:int, 5)))))])])

View File

@ -0,0 +1,5 @@
module Simple
5
end
-- -- --
s(:list, [s(:module, "Simple", [s(:int, 5)])])