diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-05 17:09:27 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-05 17:09:27 +0000 |
| commit | 0759512a5bb6d3d9e461d1f05fbc02cf2b8d7809 (patch) | |
| tree | 20dd0c6f23893b6fc5fd3b2581b292d8934b9a18 /test/ruby | |
| parent | 40c3b2f112399df840a00a2550fefcc2441f2b65 (diff) | |
* test/ruby/test_array.rb (TestArray#test_splat): Add test cases
where splat fails in when clause. ref [Bug #2468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_array.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index adac3e19d7..fe10a69e68 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -1284,4 +1284,44 @@ class TestArray < Test::Unit::TestCase a = [2,3] assert_equal([2,3], [*a], bug2401) end + + def test_splat_when + assert_equal(true, + case 2 + when 1, 2, 3 + true + else + false + end + ) + + assert_equal(true, + case 2 + when *[1, 2, 3] + true + else + false + end + ) + + a = [1, 2, 3] + assert_equal(true, + case 2 + when 1, *a + true + else + false + end + ) + + a = [1, 2, 3] + assert_equal(true, + case 2 + when *a + true + else + false + end + ) + end end |
