From 32275f4d487ccfb9a68e823f2de0063e5e4082fa Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 4 Nov 2015 20:27:48 +0200 Subject: [PATCH] fix interpreter test --- test/interpreter/test_add.rb | 2 +- test/interpreter/test_puti.rb | 2 -- test/interpreter/test_puts.rb | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/interpreter/test_add.rb b/test/interpreter/test_add.rb index 02947d99..c0e8e491 100644 --- a/test/interpreter/test_add.rb +++ b/test/interpreter/test_add.rb @@ -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 diff --git a/test/interpreter/test_puti.rb b/test/interpreter/test_puti.rb index 64ca186e..f0326397 100644 --- a/test/interpreter/test_puti.rb +++ b/test/interpreter/test_puti.rb @@ -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", diff --git a/test/interpreter/test_puts.rb b/test/interpreter/test_puts.rb index 7b4c88d5..190d55f0 100644 --- a/test/interpreter/test_puts.rb +++ b/test/interpreter/test_puts.rb @@ -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