diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_zjit.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 348907c79b..9cd0f59ffb 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -327,6 +327,22 @@ class TestZJIT < Test::Unit::TestCase }, call_threshold: 2, allowed_iseqs: 'entry@-e:2' end + def test_send_optional_arguments + assert_compiles '[[1, 2], [3, 4]]', %q{ + def test(a, b = 2) = [a, b] + def entry = [test(1), test(3, 4)] + entry + entry + }, call_threshold: 2 + end + + def test_iseq_with_optional_arguments + assert_compiles '[[1, 2], [3, 4]]', %q{ + def test(a, b = 2) = [a, b] + [test(1), test(3, 4)] + } + end + def test_invokebuiltin omit 'Test fails at the moment due to not handling optional parameters' assert_compiles '["."]', %q{ |
