bit more cleaning of testing

This commit is contained in:
Torsten Ruger 2015-10-16 18:34:54 +03:00
parent aaaef6e3d7
commit dc3920580b
6 changed files with 10 additions and 13 deletions

View File

@ -45,11 +45,6 @@ module Parfait
self.get_length self.get_length
end 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 def object_instance_names
names = List.new names = List.new
index = 3 index = 3

View File

@ -123,11 +123,6 @@ module Parfait
"'" + to_s + "'" "'" + to_s + "'"
end 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 def word_length
padded self.length padded self.length
end end

View File

@ -7,4 +7,3 @@ require_relative "test_putint"
require_relative "test_functions" require_relative "test_functions"
require_relative "test_recursive_fibo" require_relative "test_recursive_fibo"
require_relative "test_while_fibo" require_relative "test_while_fibo"
require_relative "test_methods"

View File

@ -36,8 +36,8 @@ class TestDictionary < MiniTest::Test
shouldda.each do |k,v| shouldda.each do |k,v|
@lookup.set(k,v) @lookup.set(k,v)
end end
shouldda.each do |k,v| @lookup.each do |k,v|
assert_equal v , @lookup.get(k) assert_equal v , shouldda[k]
end end
end end
end end

View File

@ -24,6 +24,13 @@ class TestLayout < MiniTest::Test
assert_equal @mess.get_layout , @mess.internal_object_get(1) , "mess" assert_equal @mess.get_layout , @mess.internal_object_get(1) , "mess"
end 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 def test_layout_is_first
layout = @mess.get_layout layout = @mess.get_layout
assert_equal nil , layout.variable_index(:layout) assert_equal nil , layout.variable_index(:layout)

View File

@ -3,6 +3,7 @@ require_relative "../helper"
class TestEmptyWord < MiniTest::Test class TestEmptyWord < MiniTest::Test
def setup def setup
Virtual.machine.boot unless Virtual.machine.booted
@word = ::Parfait::Word.new(0) @word = ::Parfait::Word.new(0)
end end
def test_word_create def test_word_create