diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 11:50:11 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 11:50:11 +0000 |
commit | 2e70b9e70db553890d7f8f864c0c66b294c3c845 (patch) | |
tree | 315526ac1c90a436aa02690e633f595512dcaf9f /test | |
parent | aec8a4b0a4eb332140d363d5c81d00eae382ff6a (diff) | |
download | ruby-2e70b9e70db553890d7f8f864c0c66b294c3c845.tar.gz |
* enum.c (enum_slice_before): take a pattern if no block given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enum.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index 2a5bd5eaa9..077be1767f 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -383,6 +383,10 @@ class TestEnumerable < Test::Unit::TestCase assert_not_same(hs[0], hs[1]) assert_not_same(hs[0], hs[2]) assert_not_same(hs[1], hs[2]) + + ss = %w[abc defg h ijk l mno pqr st u vw xy z] + assert_equal([%w[abc defg h], %w[ijk l], %w[mno], %w[pqr st u vw xy z]], + ss.slice_before(/\A...\z/).to_a) end end |