change test framework to use files for in and out (s-exp)
This commit is contained in:
7
test/cases/module_def/module_assign_var.tst
Normal file
7
test/cases/module_def/module_assign_var.tst
Normal file
@ -0,0 +1,7 @@
|
||||
module Opers
|
||||
abba = 5
|
||||
end
|
||||
-- -- --
|
||||
s(:list, [s(:module, "Opers", [s(:assign,
|
||||
s(:name, "abba"),
|
||||
s(:int, 5))])])
|
11
test/cases/module_def/module_class.tst
Normal file
11
test/cases/module_def/module_class.tst
Normal 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")))])])])
|
19
test/cases/module_def/module_function.tst
Normal file
19
test/cases/module_def/module_function.tst
Normal 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))))])])
|
25
test/cases/module_def/module_if.tst
Normal file
25
test/cases/module_def/module_if.tst
Normal 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))]))))])])
|
20
test/cases/module_def/module_ops.tst
Normal file
20
test/cases/module_def/module_ops.tst
Normal 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)))))])])
|
5
test/cases/module_def/simplest_module.tst
Normal file
5
test/cases/module_def/simplest_module.tst
Normal file
@ -0,0 +1,5 @@
|
||||
module Simple
|
||||
5
|
||||
end
|
||||
-- -- --
|
||||
s(:list, [s(:module, "Simple", [s(:int, 5)])])
|
Reference in New Issue
Block a user