aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2023-03-30 10:20:23 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2023-03-30 18:01:26 -0400
commita8782c454ce3590ecad3ec5da4a54347a7326683 (patch)
treedccbd1de716d1efd0448d48aaec8c5c946a6f4ae /bootstraptest
parentdabeec80345461160938079c9f3446b2201ea853 (diff)
downloadruby-a8782c454ce3590ecad3ec5da4a54347a7326683.tar.gz
YJIT: Test more kw and rest cases and change exit name
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 7a3e6e5e70..b7a3d3a520 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -3802,16 +3802,18 @@ assert_equal '[{"/a"=>"b", :as=>:c, :via=>:post}, [], nil]', %q{
}
# Test rest and kw_args
-assert_equal '[[["test"], nil, true], [["test"], :base, true]]', %q{
+assert_equal '[true, true, true, 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)
+ results = []
+ results << (my_func("test") == [["test"], nil, true])
+ results << (my_func("test", base: :base) == [["test"], :base, true])
+ results << (my_func("test", sort: false) == [["test"], nil, false])
+ results << (my_func("test", "other", base: :base) == [["test", "other"], :base, true])
+ results
end
-
calling_my_func
}