rubyx/test/mom/blocks/test_block_compiler.rb
Torsten Rüger 155c042009 Fix forgotten block compiler
Especially on the way down to risc
2019-08-13 19:32:17 +03:00

33 lines
825 B
Ruby

require_relative "../helper"
module Risc
class TestBlockSetup < MiniTest::Test
include Statements
def setup
super
@input = as_block("return 5")
@mom = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(as_test_main)
end
def main_risc
@mom.to_risc.method_compilers.find{|c| c.callable.name == :main }
end
def test_mom
assert_equal Mom::MomCollection , @mom.class
end
def test_mom_block_comp
assert_equal 1 , @mom.method_compilers.first.block_compilers.length
end
def test_risc
assert_equal Risc::RiscCollection , @mom.to_risc.class
end
def test_risc_comp
assert_equal :main , main_risc.callable.name
end
def test_risc_block_comp
assert_equal 1 , main_risc.block_compilers.length
end
end
end