rubyx/test/mom/assign/test_assign_local_false.rb
Torsten Rüger 4bf23defc8 fix many tests with preloading
preloading, something akin to builtin, loads some very small predefined (macro) methods for the tests to work (ie call)
2019-09-12 22:27:26 +03:00

33 lines
857 B
Ruby

require_relative '../helper'
module Risc
class TestAssignLocalFalse < MiniTest::Test
include Statements
def setup
@input = "r = false;return"
@expect = [LoadConstant, RegToSlot,LoadConstant, RegToSlot, Branch]
end
def test_local_assign_instructions
assert_nil msg = check_nil , msg
end
def test_constant_load
produced = produce_body
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 16 , 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 16 , produced.next(1).index #type == 0 , r == 16
end
end
end