aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
* Fix -e script encodingnobu2016-04-261-0/+28
| | | | | | | | * ruby.c (process_options): convert -e script to the encoding given by a command line option on Windows. assume it is the expected encoding. [ruby-dev:49461] [Bug #11900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: Add test cases for Array#sum withyui-knk2016-04-241-0/+3
| | | | | | non-numeric objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: fix command line encoding on cygwinnobu2016-04-231-3/+10
| | | | | | | * ruby.c: cygwin does not use w32_cmdvector, command line can be other than UTF-8. [ruby-dev:49519] [Bug #12184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_time_tz.rb: Tests depends on Europe/Moscow removedakr2016-04-221-13/+0
| | | | | | | | | | to avoid test failures due to the tzdata change. https://github.com/eggert/tz/commit/8ee11a301cf173afb0c76e0315b9f9ec8ebb9d95 Found by naruse. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval_jump.c: restore previous error infonobu2016-04-221-0/+18
| | | | | | | * eval_jump.c (exec_end_procs_chain): restore previous error info for each end procs. [ruby-core:75038] [Bug #12302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix dangling linknobu2016-04-181-0/+5
| | | | | | | | * compile.c (iseq_peephole_optimize): should not replace the current target INSN, not to follow the replaced dangling link in the caller. [ruby-core:74993] [Bug #11816] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: flo_truncatenobu2016-04-181-0/+26
| | | | | | | * numeric.c (flo_truncate): add an optional parameter, digits, as well as Float#round. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: int_truncatenobu2016-04-181-0/+25
| | | | | | | * numeric.c (int_truncate): add an optional parameter, digits, as well as Integer#round. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_float.rb: assertions for negative floatsnobu2016-04-181-0/+14
| | | | | | | * test/ruby/test_float.rb: add assertions for round,floor,ceil on negative floats. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* struct.c: unique membersnobu2016-04-161-0/+7
| | | | | | | * struct.c (struct_make_members_list, rb_struct_s_def): member names should be unique. [ruby-core:74971] [Bug #12291] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sum): Don't yield same element twice.akr2016-04-151-0/+7
| | | | | | | | Found by nagachika. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sum): Fix SEGV by [1/2r, 1].sum.akr2016-04-151-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_sum): use rb_rational_add directlymrkn2016-04-151-0/+2
| | | | | | | | | | | * rational.c (rb_rational_add): rename from nurat_add. * array.c (rb_ary_sum): use rb_rational_add directly. * test/ruby/test_array.rb (test_sum): add assertions for an array of Rational values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: sum for Rational and Float mixed arraysmrkn2016-04-151-0/+2
| | | | | | | | | | * array.c (rb_ary_sum): apply the precision compensated algorithm for an array in which Rational and Float values are mixed. * test/ruby/test_array.rb (test_sum): add assertions for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: defer setting name in initializenobu2016-04-151-3/+3
| | | | | | | | * thread.c (rb_thread_setname): defer setting native thread name set in initialize until the native thread is created. [ruby-core:74963] [Bug #12290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: must be initialized to set namenobu2016-04-151-0/+6
| | | | | | | | | * thread.c (get_initialized_threadptr): extract ensuring that the thread is initialized. * thread.c (rb_thread_setname): thread must be initialized to set the name. [ruby-core:74963] [Bug #12290] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_sum): add assertions for Rational andmrkn2016-04-151-4/+20
| | | | | | Complex numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add assertions.akr2016-04-141-2/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add an assertion.akr2016-04-141-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sum): Support the optional argument, init, and block.akr2016-04-141-12/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sum): Array#sum is implemented.akr2016-04-132-7/+34
| | | | | | | | | | | | | Kahan's compensated summation algorithm for precise sum of float numbers is moved from ary_inject_op in enum.c. * enum.c (ary_inject_op): Don't specialize for float numbers. [ruby-core:74569] [Feature#12217] proposed by mrkn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: flo_ceilnobu2016-04-131-0/+21
| | | | | | | * numeric.c (flo_ceil): add an optional parameter, digits, as well as Float#round. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: flo_floornobu2016-04-131-0/+22
| | | | | | | * numeric.c (flo_floor): add an optional parameter, digits, as well as Integer#floor. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: int_ceilnobu2016-04-131-0/+25
| | | | | | | * numeric.c (int_ceil): add an optional parameter, digits, as well as Integer#round. [Feature #12245] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: int_floornobu2016-04-131-0/+25
| | | | | | | * numeric.c (int_floor): add an optional parameter, digits, as well as Integer#round. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: File.empty?nobu2016-04-131-0/+7
| | | | | | | * file.c (Init_File): add alias File.empty? to File.zero?. [Feature #9969] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: massign in condnobu2016-04-132-1/+6
| | | | | | | * parse.y (assign_in_cond): allow multiple assignment in conditional expression. [Feature #10617] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_basicinstructions.rb: add a test to check accessko12016-04-131-0/+22
| | | | | | | | | | | instance variables on special const objects. All of such objects are frozen, so that we can not set instance variables for them. But we can read instance variables and return default value (nil). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_optimization.rb: disasmnobu2016-04-121-4/+10
| | | | | | | * test/ruby/test_optimization.rb (disasm): dump disassembled code for investigation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: disable tco with rescuenobu2016-04-111-0/+24
| | | | | | | | * compile.c (iseq_optimize): disable tail call optimization in rescued, rescue, and ensure blocks. [ruby-core:73871] [Bug #12082] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_whileuntil.rb: fix old behaviornobu2016-04-111-1/+1
| | | | | | | | * test/ruby/test_whileuntil.rb (test_while): fix old behavior. mere numeric literal in condition no longer matches $. global variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rubyoptions.rb: suppress warningnobu2016-04-111-1/+0
| | | | | | | * test/ruby/test_rubyoptions.rb (test_indentation_check): remove unused variable to suppress warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_regexp.rb: suppress warningnobu2016-04-111-2/+4
| | | | | | | * test/ruby/test_regexp.rb (test_named_capture): suppress "assigned but unused variable" warning by prefixing '_'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_iterator.rb: suppress warningsnobu2016-04-111-3/+3
| | | | | | | * test/ruby/test_iterator.rb (test_break): suppress "statement not reached" warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* assertions.rb: set default internal encodingnobu2016-04-0910-58/+29
| | | | | | | | | | * test/lib/test/unit/assertions.rb (assert_raise_with_message): set default internal encoding to the excpected message, which affects String#inspect in messages. * test/lib/test/unit/assertions.rb (assert_warning): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_io_m17n.rb: nil default internal encodingnobu2016-04-091-2/+2
| | | | | | | * test/ruby/test_io_m17n.rb (test_bom_non_utf): ensure default internal encoding is not set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c: rb_cstr_parse_inumnobu2016-04-081-0/+2
| | | | | | | | | | | | * bignum.c (rb_cstr_parse_inum): [EXPERIMENTAL] new function to parse integer in C-string with length. the name and the arguments may be changed in the future. * bignum.c (rb_str_to_inum): preserve encoding of the argument in error messages, and no longer needs to copy non-terminated strings. * bignum.c (rb_str2big_{poweroftwo,normal,karatsuba,gmp}): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c: fix lgammanobu2016-04-051-0/+5
| | | | | | * math.c (ruby_lgamma_r): fix lgamma(-0.0) on mingw and OSX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c: fix tgammanobu2016-04-051-0/+4
| | | | | | | * math.c (ruby_tgamma): fix tgamma(-0.0) on mingw. [ruby-core:74817] [Bug #12249] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/unicode/case-folding.rb, casefold.h: Data generation to implementduerst2016-04-011-0/+13
| | | | | | | | | | | | | swapcase functionality for titlecase characters. Swapcase isn't defined by Unicode, because the purpose/usage of swapcase is unclear anyway. The implementation follows a proposal from Nobu, swaping the case of each component of a titlecase character individually. This means that the titlecase characters have to be decomposed. * enc/unicode.c: Code using the above data. * test/ruby/enc/test_case_mapping.rb: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/unicode/case-folding.rb, casefold.h: Tweaked handling of 6duerst2016-03-291-6/+11
| | | | | | | | | | special cases in CaseUnfold_11_Table. * enc/unicode.c: Adjustments for above. * test/ruby/enc/test_case_mapping.rb: Tests for the above: Some tests in test_titlecase activated; test_greek added. A test in test_cherokee fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* sprintf.c: fix buffer overflownobu2016-03-271-0/+4
| | | | | | | | * sprintf.c (rb_str_format): fix buffer overflow, length must be greater than precision. reported by William Bowling <will AT wbowling.info>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_integer.rb: refine test_roundnobu2016-03-261-19/+29
| | | | | | | * test/ruby/test_integer.rb (test_round): refine assertions and borrow from rubyspec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/enc/test_case_mapping.rb: Additional tests title case;duerst2016-03-251-0/+9
| | | | | | | some not yet activated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* strftime.c: Bignum conversionnobu2016-03-241-0/+9
| | | | | | | * strftime.c (format_value): convert from Bignum to String, instead of rb_str_format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* strftime.c: set buffer lengthnobu2016-03-241-1/+1
| | | | | | | * strftime.c (FMTV): set the buffer length before appending to keep just put part. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* strftime.c: fix FMTVnobu2016-03-241-0/+3
| | | | | | | | * strftime.c (FMT_PADDING): extract format for padding. * strftime.c (FMT_PRECISION): extract precision formula. * strftime.c (FMTV): append formatted string to expand the result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* strftime.c: case conversionnobu2016-03-241-0/+7
| | | | | | | * strftime.c (STRFTIME): deal with case conversion flags for recursive formats. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* strftime.c: fix false failurenobu2016-03-241-0/+2
| | | | | | | | * strftime.c (rb_strftime_with_timespec): remove unnecessary check, as `s` equals to `endp` when recursed STRFTIME resized the capacity same as the size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (ary_inject_op): Use Kahan's compensated summation algorithmmrkn2016-03-231-0/+7
| | | | | | for summing up float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e