mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_hash.rb: refine a test
* test/ruby/test_hash.rb (test_exception_in_rehash): do not run twice since this test does not use @cls. making a hash may increase memory usage and should be in preparation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc52725655
commit
d4ab41e393
1 changed files with 3 additions and 1 deletions
|
@ -1208,6 +1208,8 @@ class TestHash < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exception_in_rehash
|
def test_exception_in_rehash
|
||||||
|
return unless @cls == Hash
|
||||||
|
|
||||||
bug9187 = '[ruby-core:58728] [Bug #9187]'
|
bug9187 = '[ruby-core:58728] [Bug #9187]'
|
||||||
|
|
||||||
prepare = <<-EOS
|
prepare = <<-EOS
|
||||||
|
@ -1222,10 +1224,10 @@ class TestHash < Test::Unit::TestCase
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
h = {Foo.new => true}
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
code = <<-EOS
|
code = <<-EOS
|
||||||
h = {Foo.new => true}
|
|
||||||
10_0000.times do
|
10_0000.times do
|
||||||
h.rehash rescue nil
|
h.rehash rescue nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue