2019-08-12 12:16:15 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
2019-10-03 19:55:41 +02:00
|
|
|
module SlotMachine
|
2019-08-12 12:16:15 +02:00
|
|
|
module Builtin
|
|
|
|
class TestObjectInitRisc < BootTest
|
|
|
|
def setup
|
2019-09-24 20:20:12 +02:00
|
|
|
compiler = RubyX::RubyXCompiler.new(RubyX.default_test_options)
|
2019-10-03 19:55:41 +02:00
|
|
|
coll = compiler.ruby_to_slot( get_preload("Space.main") )
|
|
|
|
@method = SlotCollection.create_init_compiler
|
2019-09-13 09:41:13 +02:00
|
|
|
end
|
2019-10-03 19:55:41 +02:00
|
|
|
def test_slot_length
|
2019-09-13 09:41:13 +02:00
|
|
|
assert_equal :__init__ , @method.callable.name
|
2019-10-03 19:55:41 +02:00
|
|
|
assert_equal 2 , @method.slot_instructions.length
|
2019-08-12 12:16:15 +02:00
|
|
|
end
|
|
|
|
def test_compile
|
|
|
|
assert_equal Risc::MethodCompiler , @method.to_risc.class
|
|
|
|
end
|
|
|
|
def test_risc_length
|
2019-09-13 19:34:41 +02:00
|
|
|
assert_equal 19 , @method.to_risc.risc_instructions.length
|
2019-08-12 12:16:15 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|