зеркало из https://github.com/github/ruby.git
add tests for [ruby-dev:34556] and [ruby-dev:34555].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
30aa6b99ca
Коммит
a60856f010
|
@ -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
|
||||
|
|
|
@ -250,6 +250,10 @@ class TestRegexp < Test::Unit::TestCase
|
|||
assert_equal(["foo", "bar", "baz"], m.values_at(1, 2, 3))
|
||||
end
|
||||
|
||||
def test_match_select
|
||||
assert_equal(["ab", "a", "b"], /(.)(.)/.match("ab").select {|v| true }, "[ruby-dev:34556]")
|
||||
end
|
||||
|
||||
def test_match_string
|
||||
m = /(?<x>b..)/.match("foobarbaz")
|
||||
assert_equal("foobarbaz", m.string)
|
||||
|
|
Загрузка…
Ссылка в новой задаче