fix allocate in builder

which accessed unknown types.
also moved assert_allocate to support
This commit is contained in:
2020-03-09 19:22:02 +02:00
parent c9fedec230
commit 8abcaa330b
5 changed files with 48 additions and 40 deletions

View File

@ -3,6 +3,8 @@ require_relative "../helper"
module Risc
class TestCompilerBuilder < MiniTest::Test
include Parfait::MethodHelper
include HasCompiler
def setup
Parfait.boot!(Parfait.default_test_options)
@method = SlotMachine::SlotCollection.compiler_for( :Space , :main,{},{}).callable
@ -18,7 +20,11 @@ module Risc
end
def test_allocate_len
int = @builder.allocate_int
assert_equal 23 , @builder.compiler.risc_instructions.length
assert_equal 22 , @builder.compiler.risc_instructions.length
end
def test_allocate
int = @builder.allocate_int
assert_allocate
end
end
end