rubyx/test/arm/test_translator.rb
Torsten Ruger c947c27a14 clean up booting
many machine boot became obsolete
or just neede parfait to boot
actual linker functionality pending
2018-07-01 14:12:42 +03:00

31 lines
681 B
Ruby

require_relative 'helper'
module Arm
class TestTranslator < MiniTest::Test
def setup
Parfait.boot!
@jump = Risc::DynamicJump.new("" , :r1)
@codes = Translator.new.translate @jump
end
def test_slot_class
assert_equal MemoryInstruction , @codes.class
end
def test_slot_left
assert_equal :r1 , @codes.left
end
def test_slot_result
assert_equal :r1 , @codes.left
end
def test_slot_right
assert_equal 16 , @codes.right
end
def test_next_from
assert_equal :r1 , @codes.next.from.symbol
end
def test_next_class
assert_equal MoveInstruction , @codes.next.class
end
end
end