fix variable expression tests
This commit is contained in:
parent
4f7110ef04
commit
f688611416
@ -1,4 +1,5 @@
|
|||||||
require_relative "test_basic"
|
require_relative "test_basic"
|
||||||
|
require_relative "test_call"
|
||||||
require_relative "test_field_access"
|
require_relative "test_field_access"
|
||||||
require_relative "test_ops"
|
require_relative "test_ops"
|
||||||
require_relative "test_call"
|
require_relative "test_vars"
|
||||||
|
34
test/typed/expressions/test_vars.rb
Normal file
34
test/typed/expressions/test_vars.rb
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
require_relative "helper"
|
||||||
|
|
||||||
|
module Register
|
||||||
|
class TestFields < MiniTest::Test
|
||||||
|
include ExpressionHelper
|
||||||
|
include AST::Sexp
|
||||||
|
|
||||||
|
def setup
|
||||||
|
Register.machine.boot
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_local
|
||||||
|
Register.machine.space.get_main.ensure_local(:bar , :Integer)
|
||||||
|
@input = s(:name, :bar)
|
||||||
|
@output = Register::RegisterValue
|
||||||
|
check
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_space
|
||||||
|
@root = :name
|
||||||
|
@input = s(:name, :space)
|
||||||
|
@output = Register::RegisterValue
|
||||||
|
check
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_args
|
||||||
|
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :bar)
|
||||||
|
@input = s(:name, :bar)
|
||||||
|
@output = Register::RegisterValue
|
||||||
|
check
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user