From 97c3c98762db01d5e85ce7198d540d2b46cca578 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 7 Feb 2012 05:29:20 +0000 Subject: * st.c (st_foreach): should not yield same pair when checking after unpacking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/st/test_numhash.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/-ext-/st/test_numhash.rb (limited to 'test/-ext-/st') diff --git a/test/-ext-/st/test_numhash.rb b/test/-ext-/st/test_numhash.rb new file mode 100644 index 0000000000..9ec072e1a5 --- /dev/null +++ b/test/-ext-/st/test_numhash.rb @@ -0,0 +1,21 @@ +require 'test/unit' +require "-test-/st/numhash" + +class Bug::StNumHash + class Test_NumHash < Test::Unit::TestCase + def setup + @tbl = Bug::StNumHash.new + 5.times {|i| @tbl[i] = i} + end + + def test_check + keys = [] + @tbl.each do |k, v, t| + keys << k + t[5] = 5 if k == 3 + true + end + assert_equal([*0..5], keys) + end + end +end -- cgit v1.2.3