fixed simple layout offset bug in layout

This commit is contained in:
Torsten Ruger
2015-10-13 14:46:07 +03:00
parent aa20f2ca77
commit 80d58ee03c
9 changed files with 132 additions and 17 deletions

View File

@ -3,8 +3,33 @@ require_relative "../helper"
class TestList < MiniTest::Test
def setup
Virtual.machine.boot unless Virtual.machine.booted
@list = ::Parfait::List.new
end
def test_old_layout
assert_equal Parfait::Layout , Virtual.machine.space.classes.keys.get_layout.class
end
def test_old_layout_push
list = Virtual.machine.space.classes.keys
list.push(1)
assert_equal Parfait::Layout , list.get_layout.class
end
def test_new_layout
assert_equal Parfait::Layout , @list.get_layout.class
end
def test_new_layout_push
@list.push(1)
assert_equal Parfait::Layout , @list.get_layout.class
end
def notest_layout_is_first
layout = @list.get_layout
assert_equal 1 , layout.variable_index(:layout)
end
def notest_layout_is_first_old
layout = Virtual.machine.space.classes.keys.get_layout
assert_equal 1 , layout.variable_index(:layout)
end
def test_list_inspect
@list.set(1,1)
assert_equal "1" , @list.inspect
@ -97,4 +122,11 @@ class TestList < MiniTest::Test
def test_first_empty
assert_equal 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
end
end