From 7316302483182a73136b00ad368585e551cbd86f Mon Sep 17 00:00:00 2001 From: marcandre Date: Wed, 14 Mar 2012 21:10:34 +0000 Subject: * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085] * array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_arity.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_arity.rb b/test/ruby/test_arity.rb index 23c2cd9e67..2d84330ffc 100644 --- a/test/ruby/test_arity.rb +++ b/test/ruby/test_arity.rb @@ -58,4 +58,14 @@ class TestArity < Test::Unit::TestCase assert_equal :ok, p.call(1, 2, 3) assert_equal :ok, p.call end + + def test_message_change_issue_6085 + assert_equal "3 for 1..2", err_mess{ SignalException.new(1, "", nil) } + assert_equal "1 for 0", err_mess{ Hash.new(1){} } + assert_equal "3 for 1..2", err_mess{ Module.send :define_method, 1, 2, 3 } + assert_equal "1 for 2", err_mess{ "".sub!(//) } + assert_equal "0 for 1..2", err_mess{ "".sub!{} } + assert_equal "0 for 1+", err_mess{ exec } + assert_equal "0 for 1+", err_mess{ Struct.new } + end end -- cgit v1.2.3