mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 04:24:04 +02:00
Allow omission of parentheses in one line pattern matching [Feature #16182]
This commit is contained in:
parent
00d66f7ec2
commit
ecb6d6a4ef
4 changed files with 27 additions and 10 deletions
|
@ -1135,5 +1135,16 @@ ruby_version_is "2.7" do
|
|||
result.should == true
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is "3.1" do
|
||||
it "can omit parentheses in one line pattern matching" do
|
||||
[1, 2] => a, b
|
||||
a.should == 1
|
||||
b.should == 2
|
||||
|
||||
{a: 1} => a:
|
||||
a.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue