summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2016-05-19fix document of Regexp#match?kazu
* re.c (rb_reg_match_m_p): [DOC] fix return value in rdoc. * test/ruby/test_regexp.rb (TestRegexp#test_match_p): add some tests from document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19* test/ruby/test_array.rb (TestArray#test_push_over_ary_max): it seems to takeusa
long time on mswinci. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19re.c: fix match?nobu
* re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19re.c: match? should return nil if no matchnobu
* re.c (rb_reg_match_m_p): should return nil if no match, as the document says. [Feature #8110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18* re.c (rb_reg_match_m_p): Introduce Regexp#match?, which returnsnaruse
bool and doesn't save backref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18* re.c (match_ary_subseq): get subseq of match array without creatingnaruse
temporary array. * re.c (match_ary_aref): get element(s) of match array without creating temporary array. * re.c (match_aref): Use match_ary_subseq with handling irregulars. * re.c (match_values_at): Use match_ary_aref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17re.c: fix up r55036nobu
* re.c (match_values_at): fix regression at r55036. MatchData#values_at accepts Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17* re.c (match_values_at): MatchData#values_at supports named capturesnaruse
[Feature #9179] * re.c (namev_to_backref_number): separeted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Optimize enum_sum for a range from int to intmrkn
* enum.c (enum_sum): Optimize for a range from int to int. * test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb, and add assertions for some conditions. * test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb. * test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Implement Enumerable#summrkn
* enum.c (enum_sum): Implement Enumerable#sum. * test/ruby/test_enum.rb (test_sum): Test sum for Enumerable. * test/ruby/test_hash.rb (test_sum): Test sum for Hash. * test/ruby/test_range.rb (test_sum): Test sum for Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Use Integer instead of Fixnum and Bignum.akr
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17[Feature #12005] Unify Fixnum and Bignum into Integerakr
* [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-15vm_insnhelper.c: deprecated constant in classnobu
* vm_insnhelper.c (vm_get_ev_const): warn deprecated constant even in the class context. [ruby-core:75505] [Bug #12382] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-13test_rand.rb: tests for seedsnobu
* test/ruby/test_rand.rb: tests for Random.raw_seed and Random.new_seed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-10* insns.def (defineclass): Also raise an error when redeclaring theeregon
superclass of a class as Object and it has another superclass. [Bug #12367] [ruby-core:75446] * test/ruby/test_class.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-10random.c: use bytesnobu
* random.c (obj_random_bytes): base on bytes method instead of rand method, not to call toplevel rand method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08file.c: home dir fall backnobu
* file.c (rb_home_dir_of): return the default home path if the user name is the current user name, on platforms where struct pwd is not supported. a temporary measure against [Bug #12226]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-06process.c: argument types over conversionnobu
* process.c (rb_exec_getargs): honor the expected argument types over the conversion method. the basic language functionality should be robust. [ruby-core:75388] [Bug #12355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-05* test/ruby/test_complexrational.rb: Remove duplicated raise.yui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-03parse.y: trace elsifnobu
* parse.y (new_if_gen): set newline flag to NODE_IF to trace all if/elsif statements. [ruby-core:67720] [Bug #10763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02* test/ruby/test_file_exhaustive.rb: test UTF-8 filename. see [Bug #12340]usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02* test/ruby/test_refinement.rb (test_inspect): Use Integer instead of Fixnum.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01* test/ruby/test_numeric.rb (test_step): Use Integer::FIXNUM_MAX.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01test_name use Integer instead of Fixnum.akr
* test/ruby/test_module.rb (test_name): Use Integer instead of Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01test/lib/test/unit/assertions.rb defines assert_fixnum and assert_bignum.akr
* test/lib/test/unit/assertions.rb (assert_fixnum): Defined. (assert_bignum): Defined. * test/ruby/test_bignum.rb: Use assert_bignum. * test/ruby/test_integer_comb.rb: Use assert_fixnum and assert_bignum. * test/ruby/test_optimization.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01envutil.rb defines Integer::{FIXNUM_MIN,FIXNUM_MAX}.akr
* test/lib/envutil.rb: Define Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/ruby/test_bignum.rb: Use Integer::{FIXNUM_MIN,FIXNUM_MAX}. * test/ruby/test_bignum.rb: Ditto. * test/ruby/test_integer_comb.rb: Ditto. * test/ruby/test_marshal.rb: Ditto. * test/ruby/test_optimization.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01Fix rb_ary_sum for mathnmrkn
* array.c (rb_ary_sum): fix for mathn * test/ruby/test_array.rb (test_sum): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01Fix a test message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-26Fix -e script encodingnobu
* 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
2016-04-24* test/ruby/test_array.rb: Add test cases for Array#sum withyui-knk
non-numeric objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-23ruby.c: fix command line encoding on cygwinnobu
* 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
2016-04-22* test/ruby/test_time_tz.rb: Tests depends on Europe/Moscow removedakr
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
2016-04-22eval_jump.c: restore previous error infonobu
* 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
2016-04-18compile.c: fix dangling linknobu
* 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
2016-04-18numeric.c: flo_truncatenobu
* 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
2016-04-18numeric.c: int_truncatenobu
* 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
2016-04-18test_float.rb: assertions for negative floatsnobu
* 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
2016-04-16struct.c: unique membersnobu
* 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
2016-04-15* array.c (rb_ary_sum): Don't yield same element twice.akr
Found by nagachika. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15* array.c (rb_ary_sum): Fix SEGV by [1/2r, 1].sum.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15array.c (rb_ary_sum): use rb_rational_add directlymrkn
* 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
2016-04-15array.c: sum for Rational and Float mixed arraysmrkn
* 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
2016-04-15thread.c: defer setting name in initializenobu
* 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
2016-04-15thread.c: must be initialized to set namenobu
* 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
2016-04-15* test/ruby/test_array.rb (test_sum): add assertions for Rational andmrkn
Complex numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-14add assertions.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-14add an assertion.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-14* array.c (rb_ary_sum): Support the optional argument, init, and block.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-13* array.c (rb_ary_sum): Array#sum is implemented.akr
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