2016-12-10 16:28:42 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2017-01-19 09:02:29 +02:00
|
|
|
module Risc
|
2016-12-10 16:28:42 +02:00
|
|
|
class TestFields < MiniTest::Test
|
|
|
|
include ExpressionHelper
|
|
|
|
include AST::Sexp
|
|
|
|
|
|
|
|
def setup
|
2017-01-19 09:02:29 +02:00
|
|
|
Risc.machine.boot
|
2016-12-10 16:28:42 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_local
|
2016-12-30 14:10:49 +02:00
|
|
|
Parfait.object_space.get_main.add_local(:bar , :Integer)
|
2017-01-16 09:34:47 +02:00
|
|
|
@input = s(:local, :bar)
|
2017-01-19 09:02:29 +02:00
|
|
|
@output = Risc::RiscValue
|
2016-12-10 16:28:42 +02:00
|
|
|
check
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_space
|
|
|
|
@root = :name
|
2017-01-16 09:34:47 +02:00
|
|
|
@input = s(:known, :space)
|
2017-01-19 09:02:29 +02:00
|
|
|
@output = Risc::RiscValue
|
2016-12-10 16:28:42 +02:00
|
|
|
check
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_args
|
2016-12-30 14:10:49 +02:00
|
|
|
Parfait.object_space.get_main.add_argument(:bar , :Integer)
|
2017-01-16 09:34:47 +02:00
|
|
|
@input = s(:arg, :bar)
|
2017-01-19 09:02:29 +02:00
|
|
|
@output = Risc::RiscValue
|
2016-12-10 16:28:42 +02:00
|
|
|
check
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|