summaryrefslogtreecommitdiff
path: root/bootstraptest/test_yjit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_yjit.rb')
-rw-r--r--bootstraptest/test_yjit.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 100cb99cee..a190d8ffb1 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -2074,6 +2074,35 @@ assert_equal '["sub", "sub"]', %q{
[foo(sub), foo(sub)]
}
+assert_equal '[1]', %q{
+ def kwargs(value:)
+ value
+ end
+
+ 5.times.map { kwargs(value: 1) }.uniq
+}
+
+assert_equal '[[1, 2]]', %q{
+ def kwargs(left:, right:)
+ [left, right]
+ end
+
+ 5.times.flat_map do
+ [
+ kwargs(left: 1, right: 2),
+ kwargs(right: 2, left: 1)
+ ]
+ end.uniq
+}
+
+assert_equal '[[1, 2]]', %q{
+ def kwargs(lead, kwarg:)
+ [lead, kwarg]
+ end
+
+ 5.times.map { kwargs(1, kwarg: 2) }.uniq
+}
+
# leading and keyword arguments are swapped into the right order
assert_equal '[[1, 2, 3, 4, 5, 6]]', %q{
def kwargs(five, six, a:, b:, c:, d:)