24 lines
547 B
Ruby
24 lines
547 B
Ruby
require_relative "helper"
|
|
|
|
module Risc
|
|
class TestTranslator < MiniTest::Test
|
|
|
|
def setup
|
|
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")}
|
|
end
|
|
def test_translate_label
|
|
label = Risc::Label.new("HI","ho" , FakeAddress.new(0))
|
|
assert_equal "ho" ,label.to_cpu(@translator).name , label
|
|
end
|
|
|
|
end
|
|
end
|