aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2023-03-24 17:01:59 -0400
committerGitHub <noreply@github.com>2023-03-24 17:01:59 -0400
commit59c3fac6c4d803019095eebb92b0d2862450ded6 (patch)
tree7794eceaec55d9212ef938cfba1f6f492562f938 /bootstraptest
parent27b1a2992f7bebd9db0b0779cc7fe9b9faf5dca4 (diff)
downloadruby-59c3fac6c4d803019095eebb92b0d2862450ded6.tar.gz
YJIT: Rest and block_arg support (#7584)
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index f428407195..64299e004e 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -3779,3 +3779,24 @@ assert_equal "ArgumentError", %q{
"ArgumentError"
end
}
+
+# Rest with block
+# Simplified code from railsbench
+assert_equal '[{"/a"=>"b", :as=>:c, :via=>:post}, [], nil]', %q{
+ def match(path, *rest, &block)
+ [path, rest, block]
+ end
+
+ def map_method(method, args, &block)
+ options = args.last
+ args.pop
+ options[:via] = method
+ match(*args, options, &block)
+ end
+
+ def post(*args, &block)
+ map_method(:post, args, &block)
+ end
+
+ post "/a" => "b", as: :c
+}