test_hash.rb: suppress warnings

* test/ruby/test_hash.rb (test_label_syntax): pass assertion
  message and suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-29 12:35:42 +00:00
parent 987df2ece6
commit 184cf1f710

View File

@ -1295,10 +1295,11 @@ class TestHash < Test::Unit::TestCase
feature4935 = '[ruby-core:37553] [Feature #4935]' feature4935 = '[ruby-core:37553] [Feature #4935]'
x = 'world' x = 'world'
hash = assert_nothing_raised(SyntaxError) do hash = assert_nothing_raised(SyntaxError, feature4935) do
break eval(%q({foo: 1, "foo-bar": 2, "hello-#{x}": 3, 'hello-#{x}': 4, 'bar': {}})) break eval(%q({foo: 1, "foo-bar": 2, "hello-#{x}": 3, 'hello-#{x}': 4, 'bar': {}}))
end end
assert_equal({:foo => 1, :'foo-bar' => 2, :'hello-world' => 3, :'hello-#{x}' => 4, :bar => {}}, hash) assert_equal({:foo => 1, :'foo-bar' => 2, :'hello-world' => 3, :'hello-#{x}' => 4, :bar => {}}, hash, feature4935)
x = x
end end
class TestSubHash < TestHash class TestSubHash < TestHash