rubyx/test/slot_machine/test_callable_compiler.rb
Torsten 64d860b2bf create a load on the compiler
thus removing the need for << with objects on RegisterValue
2020-03-22 14:31:43 +02:00

32 lines
737 B
Ruby

require_relative "helper"
module SlotMachine
# need to derive, to overwrite source_name
class FakeCallableCompiler < CallableCompiler
def source_name
"luke"
end
end
class TestCallableCompiler < MiniTest::Test
def setup
@compiler = FakeCallableCompiler.new(Risc::FakeCallable.new)
end
def test_ok
assert @compiler
end
def test_current
assert @compiler.current
end
def test_current_label
assert_equal Label , @compiler.current.class
assert_equal @compiler.source_name , @compiler.current.name
end
def test_slot
assert @compiler.slot_instructions
end
def test_const
assert_equal Array , @compiler.constants.class
end
end
end