summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-07 05:29:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-07 05:29:20 +0000
commitad40f8a268634ff94f2dad1412233a4b1f3751c5 (patch)
treee426a2cfcb4292d70b12b62a2f175cfc5f7123e9 /test
parentbdb4fa708465479259cbe2f0215376f6252b7773 (diff)
* st.c (st_foreach): should not yield same pair when checking
after unpacking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/st/test_numhash.rb21
1 files changed, 21 insertions, 0 deletions
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