summaryrefslogtreecommitdiff
path: root/test/ripper/test_sexp.rb
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2021-03-21 15:12:54 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2021-03-21 15:14:31 +0900
commit21863470d965b8cc299b1f82417c70d5d26f8ab2 (patch)
tree727faf202cf818d796602b526e17fb9bfea0cb29 /test/ripper/test_sexp.rb
parent232433f22423fb6a3ff7a610140c711a964d3b3d (diff)
Pattern matching pin operator against expression [Feature #17411]
This commit is based on the patch by @nobu.
Diffstat (limited to 'test/ripper/test_sexp.rb')
-rw-r--r--test/ripper/test_sexp.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ripper/test_sexp.rb b/test/ripper/test_sexp.rb
index 22ee418..b4e70fa 100644
--- a/test/ripper/test_sexp.rb
+++ b/test/ripper/test_sexp.rb
@@ -478,6 +478,14 @@ eot
[__LINE__, %q{ case 0; in "a\x0":a1, "a\0":a2; end }] =>
nil, # duplicated key name
+
+ [__LINE__, %q{ case 0; in ^(0+0); end } ] =>
+ [:case,
+ [:@int, "0", [1, 5]],
+ [:in,
+ [:begin, [:binary, [:@int, "0", [1, 13]], :+, [:@int, "0", [1, 15]]]],
+ [[:void_stmt]],
+ nil]],
}
pattern_matching_data.each do |(i, src), expected|
define_method(:"test_pattern_matching_#{i}") do