fix layout
amazing at this stage, but yet another index error the strange (and wonderful) thing is that changing the return of the one function just shifts the variables and everything else stays intact. Thus are the wonders of object orientation
This commit is contained in:
@ -16,7 +16,7 @@ class TestLayout < MiniTest::Test
|
||||
def test_message_by_index
|
||||
assert_equal @mess.next_message , @mess.get_instance_variable(:next_message)
|
||||
index = @mess.get_layout.variable_index :next_message
|
||||
assert_equal 3 , index
|
||||
assert_equal 2 , index
|
||||
assert_equal @mess.next_message , @mess.internal_object_get(index)
|
||||
end
|
||||
|
||||
@ -33,7 +33,7 @@ class TestLayout < MiniTest::Test
|
||||
end
|
||||
def test_layout_is_first
|
||||
layout = @mess.get_layout
|
||||
assert_equal nil , layout.variable_index(:layout)
|
||||
assert_equal 1 , layout.variable_index(:layout)
|
||||
end
|
||||
|
||||
def test_no_index_below_1
|
||||
@ -53,4 +53,26 @@ class TestLayout < MiniTest::Test
|
||||
assert_equal layout.object_instance_names.get_length , 0
|
||||
#assert_equal layout.first , :layout
|
||||
end
|
||||
|
||||
def test_attribute_set
|
||||
@mess.receiver = 55
|
||||
assert_equal 55 , @mess.receiver
|
||||
end
|
||||
|
||||
# not really parfait test, but related and no other place currently
|
||||
def test_reg_index
|
||||
message_ind = Register.resolve_index( :message , :receiver )
|
||||
assert_equal 3 , message_ind
|
||||
@mess.receiver = 55
|
||||
assert_equal 55 , @mess.internal_object_get(message_ind)
|
||||
end
|
||||
|
||||
def test_object_layout
|
||||
assert_equal 2 , @mess.get_layout.variable_index(:next_message)
|
||||
end
|
||||
|
||||
def test_remove_me
|
||||
layout = @mess.get_layout
|
||||
assert_equal layout , @mess.internal_object_get(1)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user