2019-08-13 18:32:17 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
|
|
|
module Risc
|
|
|
|
class TestBlockAssign < MiniTest::Test
|
|
|
|
include Statements
|
|
|
|
|
|
|
|
def setup
|
|
|
|
super
|
2019-08-13 19:35:27 +02:00
|
|
|
@input = as_block("a = 5")
|
2019-08-23 09:21:22 +02:00
|
|
|
@expect = [LoadConstant, RegToSlot]
|
2019-08-13 18:32:17 +02:00
|
|
|
end
|
|
|
|
def test_send_instructions
|
2019-08-14 10:11:26 +02:00
|
|
|
assert_nil msg = check_nil(:main_block) , msg
|
2019-08-13 18:32:17 +02:00
|
|
|
end
|
|
|
|
def test_load_5
|
2019-08-13 19:35:27 +02:00
|
|
|
produced = produce_block.next
|
2019-08-13 18:32:17 +02:00
|
|
|
assert_load( produced , Parfait::Integer)
|
|
|
|
assert_equal 5 , produced.constant.value
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|