diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-07 05:29:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-07 05:29:20 +0000 |
commit | 97c3c98762db01d5e85ce7198d540d2b46cca578 (patch) | |
tree | 7baa9aa493b8f207c6880c99310e2238e03fd9bc /test | |
parent | b33dc193c84598c71e088010f40267dce141fda0 (diff) | |
download | ruby-97c3c98762db01d5e85ce7198d540d2b46cca578.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/-ext-/st/test_numhash.rb | 21 |
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 |