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