update gems and fix tests

This commit is contained in:
Torsten Ruger
2016-12-06 12:08:18 +02:00
parent 4b05b48197
commit 5ac14ddccc
17 changed files with 52 additions and 79 deletions

View File

@ -17,8 +17,8 @@ require "minitest/autorun"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'test'))
require 'salama'
was = require 'salama'
puts "loaded #{was}"
class Ignored
def == other

View File

@ -1 +1,2 @@
require_relative "../helper"
Register.machine.boot unless Register.machine.booted

View File

@ -18,7 +18,7 @@ class TestAttributes < MiniTest::Test
def test_message_name_nil
last = @type.instance_names.last
assert_equal :indexed_length , last
assert_equal nil , @mess.name
assert_nil @mess.name
end
def test_message_next_set
@mess.next_message = :next_message

View File

@ -50,9 +50,9 @@ class TestClass < MiniTest::Test
assert_equal Parfait::Method , @try.get_instance_method(:foo).class
end
def test_method_get_nothere
assert_equal nil , @try.get_instance_method(:foo)
assert_nil @try.get_instance_method(:foo)
test_remove_method
assert_equal nil , @try.get_instance_method(:foo)
assert_nil @try.get_instance_method(:foo)
end
def test_resolve
foo = foo_method :Object

View File

@ -1,7 +1,6 @@
require_relative "../helper"
class TestDictionary < MiniTest::Test
Register.machine.boot #have to book, otherwise types etc not set
def setup
@lookup = ::Parfait::Dictionary.new
@ -10,8 +9,8 @@ class TestDictionary < MiniTest::Test
assert @lookup.empty?
end
def test_empty_dict_doesnt_return
assert_equal nil , @lookup.get(3)
assert_equal nil , @lookup.get(:any)
assert_nil @lookup.get(3)
assert_nil @lookup.get(:any)
end
def test_one_set1
assert_equal 1 , @lookup.set(1,1)

View File

@ -3,7 +3,6 @@ require_relative "../helper"
class TestList < MiniTest::Test
def setup
Register.machine.boot unless Register.machine.booted
@list = ::Parfait::List.new
end
def test_isa
@ -35,7 +34,7 @@ class TestList < MiniTest::Test
def test_length0
assert_equal 0 , @list.get_length
assert_equal nil , @list.indexed_length
assert_nil @list.indexed_length
end
def test_offset
assert_equal 2 , @list.get_offset
@ -67,7 +66,7 @@ class TestList < MiniTest::Test
assert_equal 0 , @list.get_length
end
def test_empty_list_doesnt_return
assert_equal nil , @list.get(3)
assert_nil @list.get(3)
end
def test_one_set1
assert_equal 2 , @list.set(1,2)
@ -122,7 +121,7 @@ class TestList < MiniTest::Test
test_many_get
assert_equal 2 , @list.index_of( :two )
assert_equal 3 , @list.index_of( :three )
assert_equal nil , @list.index_of( :four )
assert_nil @list.index_of( :four )
end
def test_inspect
test_many_get
@ -146,13 +145,13 @@ class TestList < MiniTest::Test
assert_equal :one , @list.first
end
def test_first_empty
assert_equal nil , @list.first
assert_nil @list.first
end
def test_last
test_many_get
assert_equal :three , @list.last
end
def test_last_empty
assert_equal nil , @list.last
assert_nil @list.last
end
end

View File

@ -47,8 +47,8 @@ class TestMeta < MiniTest::Test
assert_equal Parfait::Method , @try.get_instance_method(:foo).class
end
def test_method_get_nothere
assert_equal nil , @try.get_instance_method(:foo)
assert_nil @try.get_instance_method(:foo)
test_remove_method
assert_equal nil , @try.get_instance_method(:foo)
assert_nil @try.get_instance_method(:foo)
end
end

View File

@ -3,7 +3,7 @@ require_relative "../helper"
class TestMethod < MiniTest::Test
def setup
obj = Register.machine.boot.space.get_class_by_name(:Object)
obj = Register.machine.space.get_class_by_name(:Object)
args = Parfait.new_list [ Parfait::Variable.new(:Integer , :bar )]
@method = ::Parfait::Method.new obj , :foo , args
end

View File

@ -14,7 +14,7 @@ class TestObject < MiniTest::Test
end
def test_empty_object_doesnt_return
assert_equal nil , @object.get_internal_word(3)
assert_nil @object.get_internal_word(3)
end
def test_one_set1

View File

@ -3,7 +3,7 @@ require_relative "../helper"
class TestSpace < MiniTest::Test
def setup
@machine = Register.machine.boot
@machine = Register.machine
end
def classes
[:Kernel,:Word,:List,:Message,:Frame,:Type,:Object,:Class,:Dictionary,:Method , :Integer]

View File

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

View File

@ -42,12 +42,12 @@ module Register
assert_equal @label, @instruction.last
end
def test_next1
assert_equal nil , @instruction.next
assert_nil @instruction.next
end
def test_next2
@instruction.set_next @label
assert_equal @label , @instruction.next
assert_equal nil , @instruction.next(2)
assert_nil @instruction.next(2)
end
def test_replace
@instruction.append @branch