summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-20 07:17:55 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-20 07:17:55 +0000
commit2a70f68c05118775da45e630a96e89f6f57ceb39 (patch)
tree9aeaa9cd0198e44b88fdba51609b1bce75041bf3 /test
parentfe8475d7df29e5b4775272754ba1989ac9a842a4 (diff)
hide iseq operand object for duphash. [Bug #15440]
* compile.c (compile_array): hide source Hash object. * hash.c (rb_hash_resurrect): introduced to dup Hash object using rb_cHash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_literal.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/ruby/test_literal.rb b/test/ruby/test_literal.rb
index 2f3016e2498..3bb2aed65b7 100644
--- a/test/ruby/test_literal.rb
+++ b/test/ruby/test_literal.rb
@@ -290,12 +290,10 @@ class TestRubyLiteral < Test::Unit::TestCase
{0=>1,1=>4,2=>17}
end
- assert_not_include frozen_hash_literal_arg, 3
- assert_raise(FrozenError) do
- ObjectSpace.each_object(Hash) do |a|
- if a.class == Hash and !a.default_proc and a.size == 3
- a[3] = 8 if a[0] == 1 and a[1] == 4 and a[2] == 17
- end
+ ObjectSpace.each_object(Hash) do |a|
+ if a.class == Hash and !a.default_proc and a.size == 3
+ # should not be found.
+ raise
end
end
assert_not_include frozen_hash_literal_arg, 3