From a830576fb53c458e8456f73f1527a7e16d9c9062 Mon Sep 17 00:00:00 2001 From: akr Date: Thu, 1 May 2008 09:12:09 +0000 Subject: add tests for [ruby-dev:34556] and [ruby-dev:34555]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby/test_hash.rb') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 9c2978cd8..4c4dea84b 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -671,6 +671,9 @@ class TestHash < Test::Unit::TestCase assert_equal({1=>2, 3=>4}, Hash[[[1,2],[3,4]]]) assert_raise(ArgumentError) { Hash[0, 1, 2] } assert_equal({1=>2, 3=>4}, Hash[1,2,3,4]) + o = Object.new + def o.to_hash() {1=>2} end + assert_equal({1=>2}, Hash[o], "[ruby-dev:34555]") end def test_rehash2 -- cgit