summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-11-08 12:00:32 -0300
committerJemma Issroff <jemmaissroff@gmail.com>2023-11-09 09:45:59 -0300
commitae1fad4cd7d88b464aaebad3d5769d27ba675183 (patch)
treef5297aabf77829178fcc356fd91212d0debf6979 /test/ruby
parentea1b1ea1aa98bc9488564ef18aa4032aa1cb5536 (diff)
[PRISM] Implement compilation for ForwardingArgumentssNode
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index aa2dd84600..6656889388 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -861,6 +861,22 @@ module Prism
)
end
+ def test_ForwardingArgumentsNode
+ assert_prism_eval(<<-CODE)
+ def prism_test_forwarding_arguments_node(...); end;
+ def prism_test_forwarding_arguments_node1(...)
+ prism_test_forwarding_arguments_node(...)
+ end
+ CODE
+
+ assert_prism_eval(<<-CODE)
+ def prism_test_forwarding_arguments_node(...); end;
+ def prism_test_forwarding_arguments_node1(a, ...)
+ prism_test_forwarding_arguments_node(1,2, 3, ...)
+ end
+ CODE
+ end
+
def test_ForwardingSuperNode
assert_prism_eval("class Forwarding; def to_s; super; end; end")
assert_prism_eval("class Forwarding; def eval(code); super { code }; end; end")