* st.c: fix packed num_entries on delete_safe. patched by Sokolov

Yura at https://github.com/ruby/ruby/pull/84


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-03-10 14:52:06 +00:00
parent 0934e6c014
commit efae619458
5 changed files with 73 additions and 35 deletions

View file

@ -23,5 +23,14 @@ class Bug::StNumHash
assert_equal(:x, @tbl[0])
assert_equal(:x, @tbl[5])
end
def test_size_after_delete_safe
10.downto(1) do |up|
tbl = Bug::StNumHash.new
1.upto(up){|i| tbl[i] = i}
assert_equal(1, tbl.delete_safe(1))
assert_equal(up - 1, tbl.size, "delete_safe doesn't change size from #{up} to #{up-1}")
end
end
end
end