summaryrefslogtreecommitdiff
path: root/test/ruby/test_exception.rb
AgeCommit message (Collapse)Author
2016-02-19test/ruby: suppress parser warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-14test_exception.rb: fix commit missnobu
* test/ruby/test_exception.rb: remove duplicate method. fix commit miss at r53819. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-14not overwrite causenobu
* eval.c (setup_exception): set the cause only if it is explicitly given or not set yet. [Bug #12068] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-03test_exception.rb: NameError at FCALLnobu
* test/ruby/test_exception.rb (test_name_error_info): add assertions for FCALL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-12iseq.c: mark parents of wrapped iseqnobu
* iseq.c (iseqw_mark): as wrapped iseq is isolated from the call stack, it needs to take care of its parent and ancestors, so that they do not become orphans. [ruby-core:72620] [Bug #11928] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08error.c: name_err_local_variablesnobu
* error.c (name_err_local_variables): new method NameError#local_variables for internal use only. [Feature #11777] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-31test_exception.rb: get rid of did_you_meannobu
* test/ruby/test_exception.rb (test_message_of_name_error): get rid of failure caused by did_you_mean message. [ruby-core:71282] [Bug #11640] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-31eval_error.c: Fix a format of `NameError#message`nobu
* eval_error.c (undef_mesg_for): fix typo. Before this commit `ArgumentError: malformed format string - %$` was raised when `NameError#message` is called. [ruby-core:71282] [Bug #11640] [Fix GH-1077] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-28encoding for inspectnobu
* test/ruby/test_{exception,module,object}.rb: inspect result depend on the default external encoding. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-28NameError#receiver of uninitialized constantnobu
* error.c (name_err_mesg_to_str): quote the name if unprintable. * object.c (check_setter_id): use rb_check_id to convert names. * variable.c (uninitialized_constant): use NameError::message to keep the receiver of uninitialized constant. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28preserve encodings in error messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-29vm_eval.c: set method_missing_reasonnobu
* vm_eval.c (send_internal): set method_missing_reason before invoking overriding method_missing method so that the default method_missing can achieve it properly. [ruby-core:68515] [Bug #10969] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18error.c: NameError#receivernobu
* error.c (name_err_receiver): add NameError#receiver method. [Feature #10881] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-10test for [ruby-core:67473] [Bug #10727]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-29* test_exception.rb: indent.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-28* test/ruby/test_exception.rb (TestException#test_output_string_encoding): needusa
to specify the encoding of script. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-28* test/ruby/test_exception.rb (TestException#test_output_string_encoding): testusa
for r48637. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18test_exception.rb: missing testnobu
* test/ruby/test_exception.rb (test_name_error_info): add missing test of NoMethodError and NameError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15vm_eval.c: UncaughtThrowErrornobu
* vm_eval.c (rb_throw_obj): throw UncaughtThrowError instead of ArgumentError. [Feature #10480] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09Fix typos in assert messages [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-07test_exception.rb: more testsnobu
* test/ruby/test_exception.rb: more tests for catch and throw. catch but no throw, autogenerated tag, and uncaught throw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-28eval.c: no overwrite SystemStackError backtracenobu
* eval.c (setup_exception): should not overwrite SystemStackError backtrace if set already. [ruby-core:63377] [Feature #6216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-28eval.c: no method calls at stack overflownobu
* eval.c (setup_exception): get rid of method calls before raising stack overflow, not to cause stack overflow again. * defs/id.def: add IDs for backtraces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-25eval_error.c: newline alwaysnobu
* eval_error.c (error_print): put a newline after an anonymous exception class name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23Backtrace for SystemStackErrornobu
* eval.c (setup_exception): set backtrace in system stack error other than the pre-allocated sysstack_error. [Feature #6216] * proc.c (Init_Proc): freeze the pre-allocated sysstack_error. * vm_insnhelper.c (vm_stackoverflow): raise new instance for each times without calling any methods to keep the backtrace with no further stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-17eval.c: pass unknown optionsnobu
* eval.c (extract_raise_opts): pass unknown options to the exception, so that exception class can receive a hash argument. [ruby-core:63203] [Feature #8257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30add --disable-gemnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-04* test/ruby: get rid of warnings.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-26eval.c: preserve encodingnobu
* eval.c (setup_exception): preserve exception class name encoding in debug mode messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-26eval.c: preserve errinfonobu
* eval.c (setup_exception): preserve errinfo across calling #to_s method on the exception. [ruby-core:61091] [Bug #9568] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-30object.c: error message encodingnobu
* object.c (convert_type, rb_convert_type, rb_check_convert_type), (rb_to_integer): preserve class name encoding error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-30test_exception.rb: ignore SystemStackErrornobu
* test/ruby/test_exception.rb (test_machine_stackoverflow_by_define_method): ignore propagated SystemStackError, as well as test_machine_stackoverflow, which has not bee rescued in the child process by unknown reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-27thread_pthread.c: get current main thread stack sizenobu
* thread_pthread.c: get current main thread stack size, which may be expanded than allocated size at initialization, by rlimit(). [ruby-core:60113] [Bug #9454] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-31eval.c: raise with causenobu
* eval.c (rb_f_raise): add cause: optional keyword argument. [ruby-core:58610] [Feature #8257] [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10test_exception.rb: ignore SystemStackErrornobu
* test/ruby/test_exception.rb (test_machine_stackoverflow): ignore propagated SystemStackError, which has not bee rescued in the child process by unknown reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-20test_exception.rb: enclose hash defininitionnobu
* test/ruby/test_exception.rb: (test_machine_stackoverflow): enclose hash defininition because SystemStackError raises at line 3 on FreeBSD, for unknown reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-18eval_intern.h: refine stack overflow detectionnobu
* eval_intern.h (TH_PUSH_TAG, TH_EXEC_TAG): refine stack overflow detection. chain local tag after setjmp() successed on it, because calling setjmp() also can overflow the stack. [ruby-dev:47804] [Bug #9109] * vm_eval.c (rb_catch_obj): now th->tag points previous tag until TH_EXEC_TAG(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-15eval.c: refactor exception causenobu
* eval.c (setup_exception): set up cause after exception to be raised is fixed. [Feature #8257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-10error.c: Exception#causenobu
* error.c (exc_cause): captured previous exception. * eval.c (make_exception): capture previous exception automagically. [Feature #8257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28test_exception.rb: missing testnobu
* test/ruby/test_exception.rb (test_to_s): missing test for r30455. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09test/unit/assertions.rb: return exceptionnobu
* lib/test/unit/assertions.rb (assert_raise_with_message): return raised exception same as assert_raise. * test/ruby, test/-ext-: use assert_raise_with_message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-06* vm_insnhelper.c (vm_push_frame): fix stack overflow check codes.ko1
Stack overflow check should be done *after* pushing a stack frame. However, some stack overflow checking codes checked *before* pushing a stack frame with iseq->stack_max. To solve this problem, add a new parameter `stack_max' to specify a possible consuming stack size. * vm_core.h (CHECK_VM_STACK_OVERFLOW0): add to share the stack overflow checking code. * insns.def: catch up this change. * vm.c, vm_eval.c: ditto. * test/ruby/test_exception.rb: add a stack overflow test. This code is reported by nobu. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20* test/csv/test_features.rb, test/logger/test_logger.rbakr
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb, test/openssl/test_config.rb, test/psych/test_encoding.rb, test/psych/test_exception.rb, test/psych/test_psych.rb, test/psych/test_tainted.rb, test/readline/test_readline.rb, test/rexml/test_contrib.rb, test/ruby/test_autoload.rb, test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb, test/ruby/test_file.rb, test/ruby/test_io.rb, test/ruby/test_marshal.rb, test/ruby/test_process.rb, test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb, test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb, test/zlib/test_zlib.rb: Use Tempfile.create. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-19Add --disable-gems for tests which doesn't use rubygemsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19vm.c: pass through thrown objectsnobu
* vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects. [ruby-dev:46234] [Bug #7185] * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and rb_vm_jump_tag_but_local_jump() just jump tag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-02* error.c (exc_to_s, name_err_to_s, name_err_mesg_to_str): do notshugo
taint messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e