rubyx/test/risc/test_translator.rb

24 lines
547 B
Ruby
Raw Normal View History

require_relative "helper"
module Risc
class TestTranslator < MiniTest::Test
def setup
2019-02-08 22:03:23 +01:00
Parfait.boot!(Parfait.default_test_options)
@translator = Arm::Translator.new
end
def test_has_translate
assert @translator.respond_to?(:translate)
end
def test_no_translate_junk
assert_raises {@translator.translate( "Hi there")}
2018-03-26 18:43:03 +02:00
end
def test_translate_label
label = Risc::Label.new("HI","ho" , FakeAddress.new(0))
assert_equal "ho" ,label.to_cpu(@translator).name , label
2018-03-28 10:37:17 +02:00
end
end
end