2016-12-10 15:28:42 +01:00
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Register
|
|
|
|
class TestFields < MiniTest::Test
|
|
|
|
include ExpressionHelper
|
|
|
|
include AST::Sexp
|
|
|
|
|
|
|
|
def setup
|
|
|
|
Register.machine.boot
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_local
|
2016-12-30 13:10:49 +01:00
|
|
|
Parfait.object_space.get_main.add_local(:bar , :Integer)
|
2016-12-10 15:28:42 +01:00
|
|
|
@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
|
2016-12-30 13:10:49 +01:00
|
|
|
Parfait.object_space.get_main.add_argument(:bar , :Integer)
|
2016-12-10 15:28:42 +01:00
|
|
|
@input = s(:name, :bar)
|
|
|
|
@output = Register::RegisterValue
|
|
|
|
check
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|