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