mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix test failure on spec/ruby/language/pattern_matching_spec.rb
3369486308
This commit is contained in:
parent
ecb6d6a4ef
commit
f96c199449
1 changed files with 8 additions and 5 deletions
|
@ -1138,12 +1138,15 @@ ruby_version_is "2.7" do
|
||||||
|
|
||||||
ruby_version_is "3.1" do
|
ruby_version_is "3.1" do
|
||||||
it "can omit parentheses in one line pattern matching" do
|
it "can omit parentheses in one line pattern matching" do
|
||||||
|
eval(<<~RUBY).should == [1, 2]
|
||||||
[1, 2] => a, b
|
[1, 2] => a, b
|
||||||
a.should == 1
|
[a, b]
|
||||||
b.should == 2
|
RUBY
|
||||||
|
|
||||||
|
eval(<<~RUBY).should == 1
|
||||||
{a: 1} => a:
|
{a: 1} => a:
|
||||||
a.should == 1
|
a
|
||||||
|
RUBY
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue