mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
2939d61f28
commit
8b261b413c
3 changed files with 43 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue