From dc3920580ba6f856fccf9a6e2e32ac2dd75101e7 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 16 Oct 2015 18:34:54 +0300 Subject: [PATCH] bit more cleaning of testing --- lib/parfait/layout.rb | 5 ----- lib/parfait/word.rb | 5 ----- test/compiler/fragments/test_all.rb | 1 - test/parfait/test_dictionary.rb | 4 ++-- test/parfait/test_layout.rb | 7 +++++++ test/parfait/test_word.rb | 1 + 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/parfait/layout.rb b/lib/parfait/layout.rb index 6d2a2288..8f1ca1e8 100644 --- a/lib/parfait/layout.rb +++ b/lib/parfait/layout.rb @@ -45,11 +45,6 @@ module Parfait self.get_length end - # beat the recursion! fixed known offset for class object in the layout - def get_object_class() - return self.object_class - end - def object_instance_names names = List.new index = 3 diff --git a/lib/parfait/word.rb b/lib/parfait/word.rb index 5235881c..d0a9726c 100644 --- a/lib/parfait/word.rb +++ b/lib/parfait/word.rb @@ -123,11 +123,6 @@ module Parfait "'" + to_s + "'" end - #below here is OLD, DUBIOUS and needs to be checked TODO - def result= value - raise "called" - class_for(MoveInstruction).new(value , self , :opcode => :mov) - end def word_length padded self.length end diff --git a/test/compiler/fragments/test_all.rb b/test/compiler/fragments/test_all.rb index 76b5fbd0..f074b8ee 100644 --- a/test/compiler/fragments/test_all.rb +++ b/test/compiler/fragments/test_all.rb @@ -7,4 +7,3 @@ require_relative "test_putint" require_relative "test_functions" require_relative "test_recursive_fibo" require_relative "test_while_fibo" -require_relative "test_methods" diff --git a/test/parfait/test_dictionary.rb b/test/parfait/test_dictionary.rb index be57ae18..4c7d76ed 100644 --- a/test/parfait/test_dictionary.rb +++ b/test/parfait/test_dictionary.rb @@ -36,8 +36,8 @@ class TestDictionary < MiniTest::Test shouldda.each do |k,v| @lookup.set(k,v) end - shouldda.each do |k,v| - assert_equal v , @lookup.get(k) + @lookup.each do |k,v| + assert_equal v , shouldda[k] end end end diff --git a/test/parfait/test_layout.rb b/test/parfait/test_layout.rb index 35c27bf7..ab3e5049 100644 --- a/test/parfait/test_layout.rb +++ b/test/parfait/test_layout.rb @@ -24,6 +24,13 @@ class TestLayout < MiniTest::Test assert_equal @mess.get_layout , @mess.internal_object_get(1) , "mess" end + def test_forbidden_index_of + assert_raises(RuntimeError) { @mess.get_layout.index_of(:name)} + end + + def test_inspect + assert @mess.get_layout.inspect.start_with?("Layout") + end def test_layout_is_first layout = @mess.get_layout assert_equal nil , layout.variable_index(:layout) diff --git a/test/parfait/test_word.rb b/test/parfait/test_word.rb index 932fbf6f..363e157b 100644 --- a/test/parfait/test_word.rb +++ b/test/parfait/test_word.rb @@ -3,6 +3,7 @@ require_relative "../helper" class TestEmptyWord < MiniTest::Test def setup + Virtual.machine.boot unless Virtual.machine.booted @word = ::Parfait::Word.new(0) end def test_word_create