summaryrefslogtreecommitdiff
path: root/test/ruby
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-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-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-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-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-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_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-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-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-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-16rational.c: float denomnobu
* rational.c (parse_rat): allow float as a denominator as well as a numerator. [ruby-core:79104] [Bug #13134] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-16rational.c: read_numnobu
* rational.c (read_num): use rb_int_parse_cstr to parse integer parts, and make String#to_r consistent with #to_i and #to_f. [ruby-core:80098] [Bug #13105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-16test_rational.rb: invalid exponentnobu
* test/ruby/test_rational.rb (test_parse): more checks for invalid exponent. [ruby-core:80098] [Bug #13105] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-16test_rational.rb: duplicate assertionsnobu
* test/ruby/test_rational.rb (test_parse): remove duplicate assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-16rational.c: zero divisionnobu
* rational.c (read_rat_nos): denominator cannot be 0, raise zero division in that case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-16test_rational.rb: shortennobu
* test/ruby/test_rational.rb (test_parse): reduce repeated arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-15object.c: make String#to_f consistent with literalnobu
* object.c (rb_cstr_to_dbl): stop at successive underscores, as well as Float literals. [ruby-core:80098] [Bug #13105] * `_` should be within digits * only one `_` allowed between digits git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-14Fiber also has same issue. [Bug #13313]ko1
* thread.c (rb_vm_proc_local_ep): added. * cont.c (rb_fiber_start): use rb_vm_proc_local_ep(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-14thread.c: Thread.start with Symbolnobu
* thread.c (thread_do_start): fix segfault at start with Symbol. proc created by Symbol#to_proc does not have environment unless using refinements. [ruby-core:80147] [Bug #13313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13file.c: join with /nobu
* file.c (rb_file_join): join using "/" always, not a constant. and fix the document. [ruby-core:79579] [Bug #13223] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13string.c: $; is a GC-rootnobu
* string.c (Init_String): $; must be a GC-root, not to be collected. [ruby-core:79582] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-11test/ruby/test_require.rb: use squiggly heredocsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-09fix UTF-32 valid_encoding?nobu
* test/ruby/test_io_m17n.rb (TestIO_M17N#test_puts_widechar): do not use invalid codepoint. [ruby-core:79966] [Bug #13292] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-09fix UTF-32 valid_encoding?nobu
* enc/utf_32be.c (utf32be_mbc_enc_len): check arguments precisely. [ruby-core:79966] [Bug #13292] * enc/utf_32le.c (utf32le_mbc_enc_len): ditto. * regenc.h (UNICODE_VALID_CODEPOINT_P): predicate for valid Unicode codepoints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-09test_utf16.rb: refine valid_encoding testsnobu
* test/ruby/enc/test_utf16.rb (test_utf16be_valid_encoding): assert all data and use assert_predicate. * test/ruby/enc/test_utf16.rb (test_utf16le_valid_encoding): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-08proc.c: preserve class name encoding in Proc#to_snobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07parse.y: remove tracenobu
* parse.y (reg_named_capture_assign_iter): do not insert trace instructions before local variable assinments. putobject is expected at first. [ruby-core:79940] [Bug #13287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07string.c: negation of LONG_MINnobu
* string.c (rb_str_update): do not use negation of LONG_MIN, which is negative too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-02refine a warning message.akr
The "n" option for regexp, /.../n, is historical. It doesn't mean the regexp works as binary match since Ruby 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-02test: use RbConfig::Limitsnobu
* test/lib/envutil.rb: rbconfig/sizeof may not be available when cross-compiling. use RbConfig::Limits instead of calculating limits of Fixnum with hard-coded CHAR_BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e