diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2019-10-02 03:05:40 -0400 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-10-02 16:05:40 +0900 |
commit | 99d3043bd8e7705cb5ec1772080667981bd07a36 (patch) | |
tree | e1de4f7b8a1b2df3b5f66b1d03c628e72688b271 /test | |
parent | 4946d83a1cbfe23369bdbc8057592b48c673d94b (diff) |
Iseq#to_binary: dump flag for **nil (#2508)
RUBY_ISEQ_DUMP_DEBUG=to_binary and the attached test case was failing.
Dump the flag to make sure `**nil` can round-trip properly.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iseq.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 2aa6966785..30c4c2815d 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -443,6 +443,17 @@ class TestISeq < Test::Unit::TestCase end end + def test_to_binary_dumps_nokey + iseq = assert_iseq_to_binary(<<-RUBY) + o = Object.new + class << o + def foo(**nil); end + end + o + RUBY + assert_equal([[:nokey]], iseq.eval.singleton_method(:foo).parameters) + end + def test_to_binary_line_info assert_iseq_to_binary("#{<<~"begin;"}\n#{<<~'end;'}", '[Bug #14660]').eval begin; |