summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-04-20Move test_extlibs.rb because it's not the test of ruby itselfusa
* test/test_extlibs.rb: moved from test/ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19socket: avoid fcntl for read/write_nonblock on Linuxnormal
On platforms where MSG_DONTWAIT works reliably on all sockets (so far, I know of Linux), we can avoid fcntl syscalls and implement IO#write_nonblock and IO#read_nonblock in terms of the socket-specific send and recv family of syscalls. This avoids side effects on the socket, and also encourages generic code to be written in cases where IO wrappers like OpenSSL::SSL::SSLSocket are used. Perhaps in the future, side-effect-free non-blocking I/O can be standard on all files and OSes: https://cr.yp.to/unix/nonblock.html * ext/socket/lib/socket.rb (read_nonblock, write_nonblock): Linux-specific wrapper without side effects [ruby-core:80780] [Feature #13362] * test/socket/test_basicsocket.rb (test_read_write_nonblock): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18compile.c: wrong optimizationnobu
* compile.c (compile_branch_condition): expression which has side effects should not be eliminated. [ruby-core:80740] [Bug #13444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18test_optimization.rb: heredoc code stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-17should not return.ko1
* test/ruby/test_settracefunc.rb (test_throwing_return_with_finish_frame): should not use `return`, but should use `next`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-17eval.c: copy before cause setupnobu
* eval.c (setup_exception): copy frozen exception before setting up a cause not only a backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-16test_integer.rb: simplify teststomar
* test/ruby/test_integer.rb: simplify test for Integer.sqrt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-16test/ruby/test_io.rb: use Thread.stop? to waitnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-16* test/ruby/test_io.rb (test_race_closed_stream): separate because it stopsusa
entire test process on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-15bignum.c: fix inexact estimationnobu
* bignum.c (estimate_initial_sqrt): estimated square root is inexact if it is not equal to its ceil, needs Newton's method. [ruby-core:80696] [Bug #13440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-15fix RSTRUCT_LEN macro in public C APInormal
rb_struct_size returns an Integer VALUE, so it must be converted to a `long` for compatibility with previous Ruby C API versions. * ext/-test-/struct/len.c: new * test/-ext-/struct/test_len.rb: new * include/ruby/ruby.h (RSTRUCT_LEN): use NUM2LONG [ruby-core:80692] [Bug #13439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-14sync certainly.ko1
* test/ruby/test_io.rb (test_race_closed_stream): awit for 'sleep' state. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-14more explicit synchronization.ko1
* test/ruby/test_io.rb (test_race_closed_stream): wait for blocking by r.gets. On some systems (for example, high load average systems) can't start Thread correctly and can't wait r.gets in invoked Thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-14IPSocket#inspectnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-14increase timeout seconds.ko1
* test/ruby/test_trace.rb (test_trace_stackoverflow): on some platforms this test fails because of timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-13Terminate created threads.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-13thread.c: disable VM events when stack overflownobu
* thread.c (ruby_thread_stack_overflow): disable VM events when stack overflow occurred; it causes another stack overflow again in making backtrace object, and crashes. [ruby-core:80662] [Bug #13425] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12Use `assert_raise` instead of `assert_raises`.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12Merge json-2.0.4.hsbt
* https://github.com/flori/json/releases/tag/v2.0.4 * https://github.com/flori/json/blob/09fabeb03e73ed88dc8ce8f19d76ac59e51dae20/CHANGES.md#2017-03-23-204 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-09thread.c: refine stream closed messagenobu
* thread.c (Init_Thread): [EXPERIMENTAL] refine the "stream closed" special exception message, by explicating that it is caused by threading. [ruby-core:80583] [Bug #13405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-09test/unit.rb: no jobserver in workersnobu
* test/lib/test/unit.rb (Test::Unit::Parallel#process_args): worker processes do not access job server. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07use dedicated assertionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07fix condition of assert_not_respond_tonobu
* test/lib/test/unit/assertions.rb (assert_not_respond_to): fix condition to assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07assert_not_respond_to private methodnobu
* test/lib/test/unit/assertions.rb (assert_not_respond_to): allow private flag as well as assert_respond_to. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07assert_respond_to non-private methodnobu
* test/lib/test/unit/assertions.rb (assert_respond_to): do not call super class assert_respond_to when false priv is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-06fix TracePoint#return_value with non-local exitsko1
* vm.c: get return_value from imemo_throw_data object (THROW_DATA_VAL()). imemo_throw_data (TAG_BREAK) contains returned value. However, imemo_throw_data (TAG_BREAK) can skip several frames so that we need to use it only once (at most internal frame). To record it, we introduced THROW_DATA_CONSUMED and check it. * internal.h: define THROW_DATA_CONSUMED flag. * test/ruby/test_settracefunc.rb: add tests for [Bug #13369] * vm_insnhelper.h: add THROW_DATA_CONSUMED_P() and THROW_DATA_CONSUMED_SET(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-06Rename RbConfig::Limits as RbConfig::LIMITSnobu
* template/limits.c.tmpl (Init_limits): rename RbConfig::Limits as RbConfig::LIMITS, constants other than class or module are all uppercase with underscores by convention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-05Import psych-3.0.0.beta1 from ruby/psych.hsbt
* Removed deprecated code. * Removed code related syck gem. * Fixed typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-03Fix arguments order of IO#pwritekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-03Add IO#pread and IO#pwrite methodsnobu
These methods are useful for safe/concurrent file I/O in multi-thread/process environments and also fairly standard nowadays especially in systems supporting pthreads. Based on patches by Avseyev <sergey.avseyev@gmail.com> at [ruby-core:79290]. [Feature #4532] * configure.in: check for pwrite(2). pread() is already used internally for IO.copy_stream. * io.c: implement wrappers for pread(2) and pwrite(2) and expose them in IO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-01test/ruby/test_optimization.rb: quiet warningsnormal
This quiets an old "assigned but unused variable" warning left over after r56653 as well as two new "ambiguous first argment" warnings introduced in r58233. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-01compile.c: optimize literal String range in case/when dispatchnormal
This is similar in spirit to opt_case_dispatch as the literal Range here is guaranteed to be immutable when used for checkmatch. Normal range literals with non-frozen strings are actually mutable, as Range#begin and Range#end exposes the strings to modification. So those Range objects cannot be frozen without breaking compatibility, but Ranges in case/when dispatch can be frozen at compile time. * compile.c (iseq_peephole_optimize): persistent Range creation when String literals are used as beginning and end of range when used for case/when dispatch. [ruby-core:80290] [Feature #13355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-01array.c: Array#append and Array#prependnobu
* array.c (Init_Array): Add alias "append" to Array#push, and "prepend" to Array#unshift. [Feature #12746] [Fix GH-1574] Author: pascbjumper2 <stowers.joshua@live.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-29test_minitest_unit.rb: assert_triggerednobu
* test/minitest/test_minitest_unit.rb (assert_triggered): rename to be hidden in backtraces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-29test_symbol.rb: switch to assert_not_equalnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-28test/ruby/test_symbol.rb: new test for nondeterminismnormal
We need to ensure hashes for static symbols remain non-deterministic to avoid DoS attacks. This is currently the case since 2.4+, but was not for the 2.3 series. * test/ruby/test_symbol.rb (test_hash_nondeterministic): new test [ruby-core:80430] [Bug #13376] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-28ostruct.rb: refine visibility failure messagenobu
* lib/ostruct.rb (method_missing): raise an exception with proper visibility message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27dir.c: err at glob failurenobu
* dir.c (glob_helper): raise a SystemCallError exception when opendir() failed, except for ENOENT, ENOTDIR, and EACCES. this behavior predates 1.0; the comments in glob.c claimed that glob() returned -1 on error but actualy the pointer to a global variable, then dir_glob() did check only -1 as the comments, and ignored actual errors. [ruby-core:80226] [Bug #13276] dir.c: ruby_glob_funcs_t git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27fix redefinition optimization for -"literal string" (UMinus)normal
Unfortunately this enlarges insns.def by yet another instruction. However, it is much prettier than opt_str_freeze in use, and maybe we can avoid having so many instructions in the future. [ruby-core:80368] * insns.def (DEFINE_INSN): new instruction: opt_str_uminus (maybe temporary) * compile.c (iseq_compile_each0): split instructions * test/ruby/test_optimization.rb (test_string_uminus): new test * vm.c (vm_init_redefined_flag): set redefinintion flag for uminus * vm_core.h (enum ruby_basic_operators): add BOP_UMINUS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-26parse.y: unterminated content tokennobu
* parse.y (parser_parse_string): defer the end token to next reading, to yield tSTRING_CONTENT with the unterminated content. [Bug #13363] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-25class.c: prohibit refinement modulenobu
* class.c (ensure_includable): cannot include refinement module, or the type and the class do not match. [ruby-core:79632] [Bug #13236] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-25keep line number after unterminated string literalnobu
* parse.y (parser_parse_string): keep line number even after an unterminated string literal. it does not matter in the parser, ripper needs this value after this error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-24ostruct.rb: fix OpenStruct.allocatenobu
* lib/ostruct.rb (OpenStruct.allocate): initialize an instance variable directly, without calling `intialize` method which may be overridden in a subclass. [ruby-core:80292] [Bug #13358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-21stringio.c: check rangenobu
* ext/stringio/stringio.c (strio_ungetc): raise RangeError instead of TypeError at too big value, as well as IO#ungetc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-21stringio.c: check character codenobu
* ext/stringio/stringio.c (strio_ungetc): check if the character code is valid in the encoding. reported by Ahmad Sherif (ahmadsherif) at https://hackerone.com/reports/209593. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19vm_args.c: arity check of lambdanobu
* vm_eval.c (rb_yield_lambda): new function which yields an array to a proc and splat to a lambda. mainly for Enumerable only. * vm_args.c (setup_parameters_complex): remove special lambda splatting for [Bug #9605]. [ruby-core:77065] [Bug #12705] * vm_insnhelper.c (vm_callee_setup_block_arg): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-18test_lambda.rb: remove duplcate testsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-18test_lambda.rb: refine testnobu
* test/ruby/test_lambda.rb (test_lambda_as_iterator): refine a test for the intention of the original report. [ruby-core:61340] [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-18vm_args.c: pass blocknobu
* vm_args.c (refine_sym_proc_call): pass block to the method when using refinements. [ruby-core:80219] [Bug #13325] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-17* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e