diff options
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r-- | test/ruby/test_keyword.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index 13c728e8fd..1a7955dbcf 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -386,6 +386,15 @@ class TestKeywordArguments < Test::Unit::TestCase assert_equal([[:keyreq, :a], [:keyrest, :bl]], b.parameters, feature7701) assert_raise_with_message(ArgumentError, /missing keyword/, bug8139) {b.call(c: bug8139)} assert_raise_with_message(ArgumentError, /missing keyword/, bug8139) {b.call} + + b = assert_nothing_raised(SyntaxError, feature7701) do + break eval("proc {|m, a:| [m, a]}", nil, 'xyzzy', __LINE__) + end + assert_raise_with_message(ArgumentError, /missing keyword/) {b.call} + assert_equal([:ok, 42], b.call(:ok, a: 42)) + e = assert_raise_with_message(ArgumentError, /unknown keyword/) {b.call(42, a:0, b:1)} + assert_equal('xyzzy', e.backtrace_locations[0].path) + assert_equal([[:opt, :m], [:keyreq, :a]], b.parameters) end def test_super_with_keyword |