fix interpreter test

This commit is contained in:
Torsten Ruger 2015-11-04 20:27:48 +02:00
parent 642dcb065a
commit 32275f4d48
3 changed files with 3 additions and 5 deletions

View File

@ -27,7 +27,7 @@ class AddTest < MiniTest::Test
def test_get
assert_equal Register::GetSlot , ticks(4).class
assert @interpreter.get_register( :r2 )
assert @interpreter.get_register( :r2 ).is_a? Integer
assert Integer , @interpreter.get_register( :r2 ).class
end
def test_transfer
transfer = ticks 8

View File

@ -31,7 +31,6 @@ class Integer < Object
rest = self - div
if_notzero( rest )
rest = self.digit( rest )
str = str + rest
else
str = div.add_string(str)
end
@ -80,7 +79,6 @@ HERE
"GetSlot","LoadConstant","OperatorInstruction","IsZero","Label",
"LoadConstant","SetSlot","Label","Label","RegisterTransfer",
"GetSlot","FunctionReturn","GetSlot","GetSlot","SetSlot",
"GetSlot","GetSlot","GetSlot","OperatorInstruction","SetSlot",
"Label","GetSlot","SetSlot","Label","RegisterTransfer",
"GetSlot","FunctionReturn","GetSlot","SetSlot","Label",
"RegisterTransfer","GetSlot","FunctionReturn","GetSlot","Label",

View File

@ -32,13 +32,13 @@ class TestPuts < MiniTest::Test
end
def test_load
assert_equal Register::LoadConstant , ticks(3).class
assert_equal Parfait::Space , Register.machine.objects[ @interpreter.get_register(:r2)].class
assert_equal Parfait::Space , @interpreter.get_register(:r2).class
assert_equal :r2, @interpreter.instruction.array.symbol
end
def test_get
assert_equal Register::GetSlot , ticks(4).class
assert @interpreter.get_register( :r1 )
assert @interpreter.get_register( :r1 ).is_a? Integer
assert Integer , @interpreter.get_register( :r1 ).class
end
def test_transfer
transfer = ticks 8