summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2012-12-31* test/ruby/test_backtrace.rb: Add test for r37957 [Feature #7434]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-30parse.y: escaped closing parenthsisnobu
* parse.y (simple_re_meta): escaped closing parenthsis has different meaning. [Bug #7610] [ruby-core:51088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-30* test/ruby/test_keyword.rb: add a test for passing hashktsj
as a last argument. [ruby-dev:46712] [Bug #7529] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-30* vm_insnhelper.c: set keyword hash on Proc/block calls.ktsj
[ruby-core:51172] [Bug #7630] * test/ruby/test_keyword.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29object.c: singleton class clonenobu
* object.c (rb_obj_clone): attach clone to its singleton class during cloning singleton class so that singleton_method_added will be called on it. based on the patch by shiba (satoshi shiba)[Bug #5283] in [ruby-dev:44477]. [Bug #5283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29* test/ruby/test_class.rb (test_cannot_reinitialize_class_with_initialize_copy),nobu
(test_invalid_superclass): get rid of confusing ruby-mode.el. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-28vm_insnhelper.c: no splat single opt argnobu
* vm_insnhelper.c (vm_yield_setup_block_args): pass single argument to single optional parameter unchanged without splatting. [Bug #7621] [ruby-dev:46801] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-28* proc.c (method_eq): fix the documentation to refer to owner.shugo
[ruby-core:51105] [Bug #7613] * test/ruby/test_method.rb (test_alias_onwer): new test to confirm that `a == b' returns false if owners of a and b are different. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-27* variable.c (rb_mod_remove_const): fix segv caused by r38558.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-26Add opts to prevent generating core filenaruse
Given path is a dummy executable file to set as $0, not to read its content. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25test_rubyoptions.rb: ARGFnobu
* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_segv_test): to read ARGV files is ARGF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25Fix argument for assert_in_out_err to fix test failurenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25* vm_trace.c (rb_threadptr_exec_event_hooks_and_pop_frame):ko1
pop a frame before JUMP_TAG() if exception occurred. This change fix bug of Ruby 1.9. [ruby-core:51128] [ruby-trunk - Bug #7624] * vm_core.h (EXEC_EVENT_HOOK_AND_POP_FRAME): add to use `rb_threadptr_exec_event_hooks_and_pop_frame()'. * vm.c (vm_exec): use EXEC_EVENT_HOOK_AND_POP_FRAME() while exception handling. While exception hadnling, if an exception is raised in hooks, need to pop current frame and raise this raised exception by hook. * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25Add test for r38543 [Bug #7597] [ruby-dev:46786]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25error.c: rb_write_error_strnobu
* error.c (compile_err_append, compile_warn_print, warn_print): use rb_write_error_str() instead of writing to rb_stderr directly. * io.c (rb_write_error_str): a stopgap measure not to unblock GVL. warning from require seems to still have race condition errors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-24scoped constant op-assignmentnobu
* node.h (NODE_OP_CDECL), compile.c (iseq_compile_each), parse.y (stmt, arg): allow scoped constant op-assignment. [ruby-core:40154] [Bug #5449] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-24test_argf.rb: duplicated testnobu
* test/ruby/test_argf.rb (TestArgf#test_lines): remove duplicated test whose content is test_bytes actually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23* thread.c: rename methods:ko1
from Thread.async_interrupt_timing to Thread.handle_interrupt, from Thread.async_interrupted? to Thread.pending_interrupt?. Also rename option from `defer' to `never'. [ruby-core:51074] [ruby-trunk - Feature #6762] * vm_core.c, thread.c: rename functions and data structure `async_errinfo' to `pending_interrupt'. * thread.c: add global variables sym_immediate, sym_on_blocking and sym_never. * cont.c, process.c, vm.c, signal.c: ditto. * lib/sync.rb, lib/thread.rb: catch up this renaming. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22Deprecate #{lines,bytes,chars,codepoints} of IO-likes.knu
* io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints): Deprecate IO#{lines,bytes,chars,codepoints} and those of ARGF. [Feature #6670] * ext/stringio/stringio.c (strio_lines, strio_bytes, strio_chars) (strio_codepoints): Deprecate StringIO#{lines,bytes,chars,codepoints}. [Feature #6670] * ext/zlib/zlib.c (rb_gzreader_lines, rb_gzreader_bytes): Deprecate Zlib::GzipReader#{lines,bytes}. [Feature #6670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22* include/ruby/intern.h: add the prototype declaration ofmrkn
rb_num_coerce_bit. * numeric.c (rb_num_coerce_bit): the new coerce function for bitwise binary operation. * bignum.c (rb_big_and): use coerce to convert the argument, which isn't a Fixnum nor a Bignum, to the corresponding Integer object so that bitwise operations can support Integer-mimic objects. [Bug #1792] [ruby-core:39491] * bignum.c (rb_big_or): ditto. * bignum.c (rb_big_xor): ditto. * numeric.c (bit_coerce): ditto. * numeric.c (fix_and): ditto. * numeric.c (fix_or): ditto. * numeric.c (fix_xor): ditto. * test/ruby/test_integer.rb: add tests for the above changes. * test/ruby/test_bignum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22internal.h: quote unprintablenobu
* internal.h (QUOTE, QUOTE_ID): quote unprintable chars in strings and IDs. [Bug #7574] [ruby-dev:46749] * string.c (rb_str_quote_unprintable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22object.c: no nested symbolnobu
* object.c (rb_mod_const_get): symbol cannot be nested constant name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22object.c: check more strictlynobu
* object.c (rb_mod_const_get): check more strictly. [ruby-dev:46748] [Bug #7573] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22* cont.c (rb_fiber_start): in case of jump with TAG_FATAL,nagachika
enqueue error into async_errinfo_queue, because you cannot call TH_TAG_JUMP() in this function. [ruby-dev:45218] [Bug #5993] * thread.c (rb_threadptr_execute_interrupts): now INT2FIX(TAG_FATAL) can be popped from async_errinfo_queue. * vm.c (rb_vm_make_jump_tag_but_local_jump): revert r38441. rb_vm_make_jump_tag_but_local_jump() shouldn't return exception in case of state == TAG_FATAL. * test/ruby/test_fiber.rb (test_exit_in_fiber): fix a test to illuminate Thread.exit should terminate current Thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22* struct.c (make_struct): remove junk ID check to allow members whoglass
have junk name like "foo\000". * test/ruby/test_struct.rb: Test for above. [Bug #7575] [ruby-dev:46750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* test/ruby/test_iseq.rb: disable a test which checks featuresko1
removed at r38532. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21Add test for r38529 [Bug #7536]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* vm_core.h, vm_trace.c: fix multi-threading bug for tracing.ko1
Move `trace_arg' from rb_tp_t::trace_arg to rb_thread_t::trace_arg. `trace_arg' may changed by multiple threads. rb_thread_t::trace_arg can represent rb_thread_t::trace_running (null or non-null) and rb_thread_t::trace_running is removed. After that, `rb_tp_t' is not needed to check tracing or not (A running thread knows tracing or not). This is why I remove tp_attr_check_active() and make new function get_trace_arg(). And this modification disable to work the following code: TracePoint.trace{|tp| Thread.new{p tp.event} # access `tp' from other threads. } I believe nobody mix threads at trace procedure. This is current limitation. * cont.c (fiber_switch, rb_cont_call): use rb_thread_t::trace_arg instead of rb_thread_t::trace_running. * test/ruby/test_settracefunc.rb: add a multi-threading test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21test_thread.rb: descriptive assertionsnobu
* test/ruby/test_thread.rb: (test_local_barrier), (test_status_and_stop_p, test_recursive_outer, test_stack_size): use more descriptive assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21test_thread.rb: flush before SystemStackErrornobu
* test/ruby/test_thread.rb (TestThread#test_stack_size): need to flush before SystemStackError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20* vm_core.h (rb_vm_defineclass_type_t),shugo
compile.c (iseq_compile_each), insns.def (defineclass): change the meaning of the third operand of defineclass as follows: lower 3bits: the type of the defineclass 0 = class, 1 = singleton class, 2 = module 4th bit: a flag represents whether the defineclass is scoped 0 = not scoped (e.g., class Foo) 1 = scoped (e.g., class Bar::Baz) 5th bit: a flag represents whether the superclass is specified 0 = not specified (e.g., class Foo) 1 = specified (e.g., class Bar < Foo) If the superclass is specified and is not a class, a TypeError should be raised. [ruby-dev:46747] [Bug #7572] * test/ruby/test_class.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20test_require.rb: clear load pathnobu
* test/ruby/test_require.rb (test_require_invalid_shared_object), (test_require_too_long_filename, test_require_changed_current_dir), (test_require_not_modified_load_path, test_require_changed_home), (test_require_to_path_redefined_in_load_path), (test_require_to_str_redefined_in_load_path), (assert_require_with_shared_array_modified): clear preset load path so that unexpected files will not get loaded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20envutil.rb: validate syntaxnobu
* test/ruby/envutil.rb (assert_valid_syntax): move from test_syntax.rb. * test/ruby/envutil.rb (assert_normal_exit): validate syntax before running because this assertion passes even if the code fails by SyntaxError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19* vm.c: support variable VM/Machine stack sizes.ko1
Specified by the following environment variaables: - RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation. default: 128KB (32bit CPU) or 256KB (64bit CPU). - RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread creation. default: 512KB or 1024KB. - RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation. default: 64KB or 128KB. - RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber creation. default: 256KB or 256KB. This values are specified at launched timing. You can not change these values at running time. Environ variables are only *hints* because: - They are aligned to 4KB. - They have minimum values (depend on OSs). - Machine stack settings are ignored by some OSs. Default values especially fiber stack sizes are increased. This change affect Fiber's behavior: (1) You can run more complex program on a Fiber. (2) You can not make many (thousands) Fibers because of lack of address space (on 32bit CPU). If (2) bothers you, (a) Use 64bit CPU with big memory, or (b) Specify RUBY_FIBER_(VM|MACHINE)_STACK_SIZE correctly. You need to choose correct stack size carefully. These values are completely rely on systems (OS/compiler and so on). * vm_core.h (rb_vm_t::default_params): add to record above settings. * vm.c (RubyVM::DEFAULT_PARAMS): add new constant to see above setting. * thread_pthread.c: support RUBY_THREAD_MACHINE_STACK_SIZE. * cont.c: support RUBY_FIBER_(VM|MACHINE)_STACK_SIZE. * test/ruby/test_fiber.rb: add tests for above. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19* test/ruby/test_fiber.rb: remove a strange single quote character.ko1
With this character, this script exits by SyntaxError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19object.c: nul in const namenobu
* object.c (rb_mod_const_get): nul byte is invalid as constant name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19Use next in proc instead of break or returnnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19Don't check events from different files like r38456naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19Push given event only if it is right onenaruse
On parallel test-all, trace event may fire on another threads git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19Suppress warningsnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-18* vm.c (rb_vm_make_jump_tag_but_local_jump): take care of the casenagachika
TAG_JUMP() with TAG_FATAL (ex. rb_fatal()). * test/ruby/test_fiber.rb (test_fatal_in_fiber): add a test for above. * ext/-test-/fatal/extconf.rb, ext/-test-/fatal/rb_fatal.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-18Show $LOAD_PATH and RUBYLIB to debug easiernaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-17* vm_trace.c (fill_id_and_klass): TracePoint#defined_class returnsko1
singleton class. `set_trace_func' passed attached class (which is attached/modified by singleton class) by 6th block parameter if it is singleton class. Previous behavior follows this spec. However, this method named `defined_class' should return singleton class directly because singleton methods are defined in singleton class. There are no compatible issue because TracePoint is introduced after 2.0. But compatiblity with `set_trace_func' is brokne. This means that you can not replace all `set_trace_func' code with TracePoint without consideration of this behavior. [Bug #7554] * test/ruby/test_settracefunc.rb: change a test to catch up an above chagne. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-17* class.c (rewrite_cref_stack, clone_method): rewrite a method's crefcharliesome
stack when cloning into a new class to allow lexical const lookup to work as expected [ruby-core:47834] [Bug #7107] * test/ruby/test_class.rb (class TestClass): related test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15* cont.c (rb_fiber_start): don't enqueue Qnil to async_errinfo_queue.nagachika
rb_vm_make_jump_tag_but_local_jump() could return Qnil (ex. when finished by Thread.exit). [ruby-dev:45218] [Bug #5993] * test/ruby/test_fiber.rb (test_exit_in_fiber): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14* test/ruby/test_thread.rb (test_uninitialized, test_backtrace,kosaki
test_thread_timer_and_interrupt, test_thread_join_in_trap, test_thread_join_current, test_thread_join_main_thread, test_main_thread_status_at_exit, test_thread_status_in_trap, test_thread_status_raise_after_kill, test_mutex_owned, test_mutex_owned2): move these tests from TestThreadGroup class to TestThread becuase they are not thread group tests. * test/ruby/test_thread.rb (test_thread_status_raise_after_kill): add t.join. * test/ruby/test_threadgroup.rb: new file. moved ThreadGroup test form test_thread.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14* test/ruby/test_thread.rb (TestThread::Thread::new.): removekosaki
th.abort_on_exception change. Test template shouldn't change global flag. It prevent to test a normal case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14parse.y: fix line numbernobu
* parse.y (parser_params): parser_tokline to track the line number at which token started. [ruby-dev:46737] [Bug #7559] * parse.y (fcall): operation with starting line number. * parse.y (command, primary, method_call): point method name line. * parse.y (gettable_gen): return token line for __LINE__. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14envutil.rb: using caller_locationsnobu
* test/ruby/envutil.rb (Test::Unit::Assertions#assert_separately): take file and line by using caller_locations if not given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e