summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/language/pattern_matching_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/language/pattern_matching_spec.rb b/spec/ruby/language/pattern_matching_spec.rb
index 4e9d42b257..e9fc4f557d 100644
--- a/spec/ruby/language/pattern_matching_spec.rb
+++ b/spec/ruby/language/pattern_matching_spec.rb
@@ -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