fix call expression tests
This commit is contained in:
parent
4054b61752
commit
4f7110ef04
@ -1,4 +1,4 @@
|
||||
require_relative "test_basic"
|
||||
require_relative "test_field_access"
|
||||
require_relative "test_ops"
|
||||
#require_relative "test_call"
|
||||
require_relative "test_call"
|
||||
|
@ -3,6 +3,7 @@ require_relative "helper"
|
||||
module Register
|
||||
class TestCall < MiniTest::Test
|
||||
include ExpressionHelper
|
||||
include AST::Sexp
|
||||
|
||||
def setup
|
||||
Register.machine.boot
|
||||
@ -10,28 +11,28 @@ module Register
|
||||
end
|
||||
|
||||
def test_call_main_plain
|
||||
@input = 'main()'
|
||||
@input = s(:call, s(:name, :main), s(:arguments))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_main_int
|
||||
@input = 'main(1)'
|
||||
@input = s(:call, s(:name, :main), s(:arguments , s(:int, 1)))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_main_string
|
||||
@input = 'main("1")'
|
||||
@input = s(:call, s(:name, :main), s(:arguments , s(:string, "1") ))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_main_op
|
||||
Register.machine.space.get_main.ensure_local(:bar , :Integer)
|
||||
@input = 'main( bar )'
|
||||
@input = s(:call, s(:name, :main), s(:arguments , s(:name, :bar) ))
|
||||
check
|
||||
end
|
||||
|
||||
def test_call_string_put
|
||||
@input = '"Hello Raisa, I am salama".putstring()'
|
||||
@input = s(:call, s(:name, :putstring), s(:arguments), s(:receiver, s(:string, "Hello Raisa, I am salama")))
|
||||
check
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user