2019-08-12 12:16:15 +02:00
|
|
|
require_relative "helper"
|
|
|
|
|
|
|
|
module Mom
|
|
|
|
module Builtin
|
|
|
|
class TestObjectInitRisc < BootTest
|
|
|
|
def setup
|
2019-09-13 19:34:41 +02:00
|
|
|
Parfait.boot!(Parfait.default_test_options)
|
|
|
|
get_compiler("Space",:main)
|
|
|
|
@method = MomCollection.create_init_compiler
|
2019-09-13 09:41:13 +02:00
|
|
|
end
|
|
|
|
def test_mom_length
|
|
|
|
assert_equal :__init__ , @method.callable.name
|
2019-09-13 19:34:41 +02:00
|
|
|
assert_equal 2 , @method.mom_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
|