fixing offset bug

found by tests that overwrite the attribute
This commit is contained in:
Torsten Ruger
2015-10-26 12:57:54 +02:00
parent 1a236aa50e
commit d2c670b31a
3 changed files with 15 additions and 11 deletions

View File

@ -33,6 +33,15 @@ class TestList < MiniTest::Test
assert_equal 1 , layout.variable_index(:layout)
end
def test_length0
assert_equal 0 , @list.get_length
assert_equal nil , @list.indexed_length
end
def test_length1
@list.push :one
assert_equal 1 , @list.get_length
assert_equal 1 , @list.indexed_length
end
def test_list_inspect
@list.set(1,1)
assert_equal "1" , @list.inspect
@ -54,7 +63,7 @@ class TestList < MiniTest::Test
end
def test_one_set1
assert_equal 2 , @list.set(1,2)
assert_equal 1 , @list.internal_object_get(1)
assert_equal 1 , @list.internal_object_get(2)
end
def test_set1_len
@list.set(1,1)