summaryrefslogtreecommitdiff
path: root/test/-ext-/st
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-10 14:52:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-10 14:52:06 +0000
commitefae6194582001cb12108bc101d22dc1ed9a660c (patch)
treeffc8141e760ab852a85ccd7592efd60be2d542dd /test/-ext-/st
parent0934e6c014fdbf178b1dd0d4f27c3e857491d641 (diff)
* 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
Diffstat (limited to 'test/-ext-/st')
-rw-r--r--test/-ext-/st/test_numhash.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/-ext-/st/test_numhash.rb b/test/-ext-/st/test_numhash.rb
index c092049..53dbfed 100644
--- a/test/-ext-/st/test_numhash.rb
+++ b/test/-ext-/st/test_numhash.rb
@@ -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