From 8b261b413c288d7e15851ebbb391fd98322aaeba Mon Sep 17 00:00:00 2001 From: wanabe Date: Sat, 17 Apr 2010 00:23:28 +0000 Subject: * compile.c (iseq_compile_each): fix splat condition in NODE_WHEN. [Bug #2226] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_case.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/ruby/test_case.rb b/test/ruby/test_case.rb index c4bffa811f..98498dada6 100644 --- a/test/ruby/test_case.rb +++ b/test/ruby/test_case.rb @@ -53,6 +53,26 @@ class TestCase < Test::Unit::TestCase else assert(false) end + + case + when *[], false + assert(false) + else + assert(true) + end + + case + when *false, [] + assert(true) + else + assert(false) + end + + assert_raise(NameError) do + case + when false, *x, false + end + end end def test_deoptimization -- cgit v1.2.3