renames Typed to Vm
This commit is contained in:
43
test/vm/method_compiler/test_call_expression.rb
Normal file
43
test/vm/method_compiler/test_call_expression.rb
Normal file
@ -0,0 +1,43 @@
|
||||
require_relative "helper"
|
||||
|
||||
module Register
|
||||
class TestCall < MiniTest::Test
|
||||
include ExpressionHelper
|
||||
include AST::Sexp
|
||||
|
||||
def setup
|
||||
Register.machine.boot
|
||||
@output = Register::RegisterValue
|
||||
end
|
||||
|
||||
def test_call_main_plain
|
||||
@input = s(:call,s(:name, :main),s(:arguments))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_main_int
|
||||
Parfait.object_space.get_main.add_argument(:blar , :Integer)
|
||||
@input =s(:call,s(:name, :main),s(:arguments , s(:int, 1)))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_main_string
|
||||
Parfait.object_space.get_main.add_argument(:blar , :Word)
|
||||
@input =s(:call,s(:name, :main),s(:arguments , s(:string, "1") ))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_main_op
|
||||
Parfait.object_space.get_main.add_local(:bar , :Integer)
|
||||
Parfait.object_space.get_main.add_argument(:blar , :Integer)
|
||||
@input =s(:call,s(:name, :main),s(:arguments , s(:name, :bar) ))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_string_put
|
||||
@input = s(:call,s(:name, :putstring),s(:arguments),s(:receiver,s(:string, "Hello Raisa, I am salama")))
|
||||
check
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user