summaryrefslogtreecommitdiff
path: root/test/ripper/test_sexp.rb
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2020-06-14 09:24:36 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2020-06-14 09:24:36 +0900
commitddded1157a90d21cb54b9f07de35ab9b4cc472e1 (patch)
tree315005f4eead6840846e6ce4bbd4dfa44c3bfce7 /test/ripper/test_sexp.rb
parentf7906a7e31e6b1cfa135ecea69deb8827e8c8803 (diff)
Introduce find pattern [Feature #16828]
Diffstat (limited to 'test/ripper/test_sexp.rb')
-rw-r--r--test/ripper/test_sexp.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/ripper/test_sexp.rb b/test/ripper/test_sexp.rb
index 89b4594..47339ba 100644
--- a/test/ripper/test_sexp.rb
+++ b/test/ripper/test_sexp.rb
@@ -412,6 +412,43 @@ eot
[:@int, "0", [1, 5]],
[:in, [:aryptn, nil, nil, nil, nil], [[:void_stmt]], nil]],
+ [__LINE__, %q{ 0 in [*, a, *] }] =>
+ [:case,
+ [:@int, "0", [1, 0]],
+ [:in,
+ [:fndptn,
+ nil,
+ [:var_field, nil],
+ [[:var_field, [:@ident, "a", [1, 9]]]],
+ [:var_field, nil]],
+ nil,
+ nil]],
+
+ [__LINE__, %q{ 0 in [*a, b, *c] }] =>
+ [:case,
+ [:@int, "0", [1, 0]],
+ [:in,
+ [:fndptn,
+ nil,
+ [:var_field, [:@ident, "a", [1, 7]]],
+ [[:var_field, [:@ident, "b", [1, 10]]]],
+ [:var_field, [:@ident, "c", [1, 14]]]],
+ nil,
+ nil]],
+
+ [__LINE__, %q{ 0 in A(*a, b, c, *d) }] =>
+ [:case,
+ [:@int, "0", [1, 0]],
+ [:in,
+ [:fndptn,
+ [:var_ref, [:@const, "A", [1, 5]]],
+ [:var_field, [:@ident, "a", [1, 8]]],
+ [[:var_field, [:@ident, "b", [1, 11]]],
+ [:var_field, [:@ident, "c", [1, 14]]]],
+ [:var_field, [:@ident, "d", [1, 18]]]],
+ nil,
+ nil]],
+
[__LINE__, %q{ case 0; in {a: 0}; end }] =>
[:case,
[:@int, "0", [1, 5]],