diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-10-26 18:00:24 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-26 18:00:24 +0900 |
commit | 52c630da004d9273e8e5fc91c6304e9eed902566 (patch) | |
tree | 8414c98aa099355174ca6525757128d560ce5f8a /spec/ruby/language | |
parent | cffdacb15a363321e1c1879aa7d94924acafd1cf (diff) |
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC
R-assignment is rejected instead.
Notes
Notes:
Merged-By: nobu <[email protected]>
Diffstat (limited to 'spec/ruby/language')
-rw-r--r-- | spec/ruby/language/pattern_matching_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/ruby/language/pattern_matching_spec.rb b/spec/ruby/language/pattern_matching_spec.rb index 91ad23bf32..2d22ec7e64 100644 --- a/spec/ruby/language/pattern_matching_spec.rb +++ b/spec/ruby/language/pattern_matching_spec.rb @@ -9,11 +9,13 @@ ruby_version_is "2.7" do ScratchPad.record [] end - it "can be standalone in operator that deconstructs value" do - eval(<<-RUBY).should == [0, 1] - [0, 1] in [a, b] - [a, b] - RUBY + ruby_version_is "3.0" do + it "can be standalone assoc operator that deconstructs value" do + eval(<<-RUBY).should == [0, 1] + [0, 1] => [a, b] + [a, b] + RUBY + end end it "extends case expression with case/in construction" do |