rubyx/test/mom/assign/test_assign_local_false.rb

34 lines
837 B
Ruby
Raw Normal View History

2018-03-19 11:58:53 +01:00
require_relative '../helper'
module Risc
2018-04-19 18:23:12 +02:00
class TestAssignLocalFalse < MiniTest::Test
include Statements
def setup
super
2018-04-19 18:23:12 +02:00
@input = "r = false"
@expect = [LoadConstant,SlotToReg, RegToSlot]
end
def test_local_assign_instructions
assert_nil msg = check_nil , msg
end
def test_constant_load
produced = produce_body
2018-04-19 18:23:12 +02:00
assert_equal Parfait::FalseClass , produced.constant.class
end
def test_frame_load
produced = produce_body
assert_equal :Message , produced.next(1).array.type.class_name
assert_equal 3 , produced.next(1).index # 3 is frame
end
def test_value_load
produced = produce_body
assert_equal produced.next(2).register , produced.register
assert_equal 1 , produced.next(2).index #type == 0 , r == 1
end
end
end