Fix forgotten block compiler
Especially on the way down to risc
This commit is contained in:
32
test/mom/blocks/test_block_compiler.rb
Normal file
32
test/mom/blocks/test_block_compiler.rb
Normal file
@ -0,0 +1,32 @@
|
||||
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
|
Reference in New Issue
Block a user