last test fixed, ruby layer complete
This commit is contained in:
parent
b00b0cf064
commit
f620f0fd74
@ -14,6 +14,7 @@ module Risc
|
|||||||
assert !@pos.valid?
|
assert !@pos.valid?
|
||||||
end
|
end
|
||||||
def test_next_slot
|
def test_next_slot
|
||||||
|
Parfait.boot!
|
||||||
mov = Arm::ArmMachine.mov(:r1 , :r1)
|
mov = Arm::ArmMachine.mov(:r1 , :r1)
|
||||||
position = Position.new(mov ).set(0)
|
position = Position.new(mov ).set(0)
|
||||||
assert_equal 4, position.next_slot
|
assert_equal 4, position.next_slot
|
||||||
|
@ -61,22 +61,4 @@ module Ruby
|
|||||||
assert_nil lst.name
|
assert_nil lst.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class TestSendReceiverType < MiniTest::Test
|
|
||||||
include RubyTests
|
|
||||||
|
|
||||||
def setup
|
|
||||||
Parfait.boot!
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_int_receiver
|
|
||||||
sent = compile( "5.div4")
|
|
||||||
assert_equal Parfait::Type , sent.receiver.ct_type.class
|
|
||||||
assert_equal "Integer_Type" , sent.receiver.ct_type.name
|
|
||||||
end
|
|
||||||
def test_string_receiver
|
|
||||||
sent = compile( "'5'.putstring")
|
|
||||||
assert_equal Parfait::Type , sent.receiver.ct_type.class
|
|
||||||
assert_equal "Word_Type" , sent.receiver.ct_type.name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -39,7 +39,7 @@ module MomCompile
|
|||||||
end
|
end
|
||||||
def compile_first_block( block_input , method_input = "main_local = 5")
|
def compile_first_block( block_input , method_input = "main_local = 5")
|
||||||
source = "#{method_input} ; self.main{|val| #{block_input}}"
|
source = "#{method_input} ; self.main{|val| #{block_input}}"
|
||||||
vool = RubyX::RubyCompiler.compile( as_test_main(source) ).normalize
|
vool = Ruby::RubyCompiler.compile( as_test_main(source) ).to_vool
|
||||||
mom_c = vool.to_mom(nil)
|
mom_c = vool.to_mom(nil)
|
||||||
compiler = mom_c.method_compilers.find{|c| c.get_method.name == :main and c.get_method.self_type.object_class.name == :Test}
|
compiler = mom_c.method_compilers.find{|c| c.get_method.name == :main and c.get_method.self_type.object_class.name == :Test}
|
||||||
block = nil
|
block = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user