summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2011-11-03* test/ruby/test_process.rb: clean up a garbage character.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03add test for close-on-exec.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-02* complex.c (nucomp_rationalize): fix function. [ruby-core:40667]nobu
[Bug #5546] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01* test/ruby/test_marshal.rb: renamed methods duplicated with thoseshugo
of marshaltestlib.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-27* bignum.c (rb_big_divide): raise ZeroDivisionError if divisor isnobu
zero, as well as Fixnum. [ruby-core:40429] [Bug #5490] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-27* test/ruby/test_bignum.rb: ensure constants to be Bignum.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-26* file.c (rb_file_join): honor input encodings than ASCII-8BIT.nobu
[ruby-core:40338] [Bug #5483] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-23* io.c (copy_stream_fallback_body): check nil for EOF of read method.akr
patch by Eric Wong. [ruby-core:39134] [Bug #5237] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22* include/ruby/intern.h (rb_fd_set_cloexec): declared.akr
* io.c (rb_fd_set_cloexec): new function. (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag. (rb_sysopen_internal): ditto. (rb_pipe): ditto. (io_reopen): ditto. (io_cntl): ditto. * process.c (rb_f_exec): change the default :close_others option to true. (rb_f_system): ditto. (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set close-on-exec flag. (ruby_setsid): ditto. (rb_daemon): ditto. * thread_pthread.c (rb_thread_create_timer_thread): call rb_fd_set_cloexec to set close-on-exec flag. * ruby.c (load_file_internal): ditto. * file.c (rb_file_s_truncate): ditto. (file_load_ok): ditto. * random.c (fill_random_seed): ditto. * ext/pty/pty.c (chfunc): ditto. (get_device_once): ditto. * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto. * ext/socket/init.c (rsock_socket): ditto. (rsock_s_accept_nonblock): ditto. (rsock_s_accept): ditto. * ext/socket/socket.c (rsock_sock_s_socketpair): ditto. * ext/socket/ancdata.c (discard_cmsg): ditto. (make_io_for_unix_rights): ditto. * ext/socket/unixsocket.c (unix_recv_io): ditto. * ext/io/console/console.c (console_dev): ditto. [ruby-core:38140] [Feature #5041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-07* test/-ext-/symbol/test_inadvertent_creation.rb: moved tests fromnobu
test_module.rb and test_symbol.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-05Revert r33407; half-baked patch.naruse
"* numeric.c (ruby_float_step): improve floating point calculations." git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-05* numeric.c (ruby_float_step): improve floating point calculations.naruse
[ruby-core:35753] [Bug #4576] * numeric.c (ruby_float_step): correct the error of floating point numbers on the excluding case. patched by Masahiro Tanaka [ruby-core:39608] * numeric.c (ruby_float_step): use the end value when the current value is greater than or equal to the end value. patched by Akira Tanaka [ruby-core:39612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04* gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04Fix test of gc introduced in r33379.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03* gc.c (rb_gc_set_params): output GC parameter change messages onlynagachika
if -w/-v options are specified. these messages are output to stderr, not to stdout. [ruby-core:39795] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-01* gc.c (add_heap_slots, init_heap): reset heaps_inc zero whennagachika
heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS. [ruby-core:39777] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to enable pass environemnt variables to child process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-30* test/ruby/test_bignum.rb: use more descriptive assertions.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-30* test/ruby/test_bignum.rb (TestBignum#test_interrupt): fix fornobu
faster CPU. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-30Fix wrong expectaion of r33363.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* array.c (ary_join_1): should not copy the encoding of non-stringnobu
element after string element. [ruby-core:39776] [Bug #5379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25* encoding.c (require_enc): reject only loading from untrustednobu
load paths. [ruby-dev:44541] [Bug #5279] * transcode.c (load_transcoder_entry): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-24* enum.c (slice_before_i): use rb_attr_get to surpress wrong warningnaruse
for internal instance variable slicebefore_initial_state. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-18* object.c (rb_obj_clone): singleton class should be attachednobu
singleton object to. a patch by Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:44460]. [Bug #5274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-12* test/ruby/test_exception.rb (TestException#test_exit_success_p):nobu
assert also the cases when exiting with true and false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-10Revert test fixes.naruse
This reverts r33233, r33234, and r33235. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09Run GC.start before test_too_long_path.naruse
NoMemoryError is raised in MiniTest#exception_details where exception is made, and no effect. Run GC.start before running to keep the room. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09Catch NoMemoryError.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-09Decide by majority.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06* encoding.c (load_encoding): predefined encoding names are safe.nobu
[ruby-dev:44469] [Bug #5279] * transcode.c (load_transcoder_entry): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-06* transcode.c: enabled econv newline option.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05* test/ruby/test_float.rb (TestFloat#test_round): show the number in question.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):ktsj
add a test. Unlike TestThread#test_no_valid_cfp, this test succeeds even if win32ole is required (see r33153). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* variable.c (rb_const_set): show the previous definitionnobu
location. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* io.c (argf_next_argv): open in default text mode.nobu
[ruby-core:39234] [Bug #5268] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* test/ruby/test_encoding.rb (test_find): mingw is not Unix, of course.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02* vm_insnhelper.c (vm_search_const_defined_class): searchnobu
ancestors only when global scope. [ruby-core:39227] [Bug #5264] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-02* parse.y (parser_tokadd_string, parser_yylex): ignore a backslashnobu
which prefixes an non-ascii character, which has no escape syntax. [ruby-core:39222] [Ruby 1.9 - Bug #5262] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01* numeric.c (flo_round): substitute machine dependent magic number.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01* insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): seenobu
also inherited constants for classes without superclass and modules. [ruby-core:37698] [Bug #3423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01* test/ruby/test_thread.rb (TestThread#test_no_valid_cfp): skip whenusa
win32ole is required. in such case, win32ole redefines Thread#initialize, and the block argument becomes to be not the top of the thread, then this testcase always fails. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,usa
default_mode_on_unix,text_mode,binary_mode}): sorry for wrong test committed in r33144. I'd misunderstood the spec of ruby's universal newline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31* Re-apply r33078, thread-safe autoload which is reverted at r33093.nahi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31* test/ruby/test_io_m17n.rb (TestIO_M17N#test_{default_mode_on_dosish,usa
default_mode_on_unix,text_mode,binary_mode}): tests for [Bug # 5164]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29* test/ruby/test_numeric.rb (test_num2long): modify a test agaist themrkn
change by r33108. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29* numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted formrkn
bitwise arithmetic with a Fixnum. #1792 * test/ruby/test_fixnum.rb: add tests for the above change. * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for bitwise arithmetic with a Bignum. #1792 * test/ruby/test_bignum.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27* strftime.c (rb_strftime_with_timespec): get enc argument to specifynaruse
the encoding of the format. On Windows (at least Japanese Windows), Time#strftime("%Z") includes non ASCII in locale encoding (CP932). So convert locale to default internal. [ruby-core:39092] [Bug #5226] * strftime.c (rb_strftime): ditto. * strftime.c (rb_strftime_timespec): ditto. * internal.h (rb_strftime_timespec): follow above. * time.c (rb_strftime_alloc): ditto. * time.c (strftimev): ditto. * time.c (time_strftime): ditto. * time.c (time_to_s): the resulted string of Time#to_s is always ascii only, so this should be US-ASCII. * time.c (time_asctime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-27* Revert r33078. It caused a Rails application NoMethodError.nahi
/home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/utils.rb:157: warning: toplevel constant ScanError referenced by Regin::Parser::ScanError /home/nahi/git/emptyApp/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/vendor/regin/regin/parser.rb:17:in `parse_regexp': undefined method `scan_str' for #<Regin::Parser:0x00000002344548> (NoMethodError) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-26* variable.c: Make autoload thread-safe. See #921.nahi
What's the problem? autoload is thread unsafe. When we define a constant to be autoloaded, we expect the constant construction is invariant. But current autoload implementation allows other threads to access the constant while the first thread is loading a file. What's happening inside? The current implementation uses Qundef as a marker of autoload in Constant table. Once the first thread find Qundef as a value at constant lookup, it starts loading a defined feature. Generally a loaded file overrides the Qundef in Constant table by module/class declaration at very beginning lines of the file, so other threads can see the new Module/Class object before feature loading is finished. It breaks invariant construction. How to solve? To ensure invariant constant construction, we need to override Qundef with defined Object after the feature loading. For keeping Qundef in Constant table, I expanded autoload_data struct in Module to have a slot for keeping the defined object while feature loading. And changed Module's constant lookup/update logic a little so that the slot is only visible from the thread which invokes feature loading. (== the first thread which accessed the autoload constant) Evaluation? All test passes (bootstrap test, test-all and RubySpec) and added 8 tests for threading behavior. Extra logics are executed only when Qundef is found, so no perf drop should happen except autoloading. * variable.c (rb_autoload): Prepare new autoload_data struct. * variable.c (rb_autoload_load): Load feature and update Constant table after feature loading is finished. * variable.c (rb_const_get_0): When the fetched constant is under autoloading, it returns the object only for the thread which starts autoloading. * variable.c (rb_const_defined_0): Ditto. * variable.c (rb_const_set): When the specified constant is under autoloading, it sets the object only for the thread which starts autoloading. Otherwise, simply overrides Qundef with constant override warning. * vm_insnhelper.c (vm_get_ev_const): Apply same change as rb_const_get_0 in variable.c. * test/ruby/test_autoload.rb: Added tests for threading behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25* time.c (strftimev): Make Time#to_s default to US-ASCII encoding buttenderlove
respect Encoding.default_internal. [ruby-core:39092] * test/ruby/test_time.rb (class TestTime): Corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24* test/ruby/test_rubyoptions.rb (test_script_from_stdin): slave ptyngoto
should be manipulated because master pty may not be a tty on some environment (e.g. Solaris). [Bug:#5222] [ruby-dev:44420] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e