mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_hash.rb: add test
* test/ruby/test_hash.rb (test_try_convert): Add test for Hash.try_convert. [Fix GH-1190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa8920288c
commit
4b346b0e71
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Jan 9 23:19:14 2016 Kuniaki IGARASHI <igaiga@gmail.com>
|
||||
|
||||
* test/ruby/test_hash.rb (test_try_convert): Add test for
|
||||
Hash.try_convert. [Fix GH-1190]
|
||||
|
||||
Sat Jan 9 23:15:25 2016 Jon Moss <maclover7@users.noreply.github.com>
|
||||
|
||||
* ext/openssl/ossl.c: Add missing variables to documentation
|
||||
|
|
|
@ -148,6 +148,14 @@ class TestHash < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
def test_try_convert
|
||||
assert_equal({1=>2}, Hash.try_convert({1=>2}))
|
||||
assert_equal(nil, Hash.try_convert("1=>2"))
|
||||
o = Object.new
|
||||
def o.to_hash; {3=>4} end
|
||||
assert_equal({3=>4}, Hash.try_convert(o))
|
||||
end
|
||||
|
||||
def test_AREF # '[]'
|
||||
t = Time.now
|
||||
h = @cls[
|
||||
|
|
Loading…
Reference in a new issue