aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2023-03-29 12:31:41 -0400
committerGitHub <noreply@github.com>2023-03-29 12:31:41 -0400
commita8c6ba23a6a95272edd6179737d4f98d7b2cdf6e (patch)
tree15d2e4559aaa4baee24305563dba06bc13efb2c5 /bootstraptest
parentb168141c7888a5237249b13d630f2a56a66f53f9 (diff)
downloadruby-a8c6ba23a6a95272edd6179737d4f98d7b2cdf6e.tar.gz
YJIT: Rest and keyword (non-supplying) (#7608)
* YJIT: Rest and keyword (non-supplying) * Update yjit/src/codegen.rs --------- Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 64299e004e..7a3e6e5e70 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -3800,3 +3800,18 @@ assert_equal '[{"/a"=>"b", :as=>:c, :via=>:post}, [], nil]', %q{
post "/a" => "b", as: :c
}
+
+# Test rest and kw_args
+assert_equal '[[["test"], nil, true], [["test"], :base, true]]', %q{
+ def my_func(*args, base: nil, sort: true)
+ [args, base, sort]
+ end
+
+ def calling_my_func
+ result = []
+ result << my_func("test")
+ result << my_func("test", base: :base)
+ end
+
+ calling_my_func
+}