fix word implementation and tests

much better, though wasteful implementation
breaks a few tests, but ploughing on first
This commit is contained in:
Torsten Ruger
2015-05-15 16:45:36 +03:00
parent 164816c441
commit 0731a6061a
8 changed files with 155 additions and 55 deletions

View File

@ -8,15 +8,26 @@ class TestList < MiniTest::Test
def test_list_create
assert @list.empty?
end
def test_list_len
assert_equal 0 , @list.length
end
def test_empty_list_doesnt_return
assert_equal nil , @list.get(3)
end
def test_one_set0
assert_equal 1 , @list.set(0,1)
end
def test_set0_len
@list.set(0,1)
assert_equal 1 , @list.length
end
def test_one_set1
assert_equal :some , @list.set(1,:some)
end
def test_set1_len
@list.set(1,:some)
assert_equal 2 , @list.length
end
def test_two_sets
assert_equal 1 , @list.set(0,1)
assert_equal :some , @list.set(1,:some)