summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_array.rb
Commit message (Collapse)AuthorAgeFilesLines
* Decrease counts of tests which spend so long time.naruse2009-11-041-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_eval.c (rb_search_method_emtry, rb_method_call_status): splitnobu2009-10-301-0/+12
| | | | | | | | | | | | from rb_call0(). * vm_eval.c (rb_check_funcall): get rid of raising exceptions and hiding further exceptions. [ruby-dev:39584] * vm_eval.c (rb_funcall_no_recursive): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_exec_recursive_outer, rb_exec_recursive): Added method to ↵marcandre2009-09-151-1/+2
| | | | | | | | | | | | | | | | | | short-circuit to the outermost level in case of recursion * test/ruby/test_thread.rb (test_recursive_outer): Test for above * hash.c (rb_hash_hash): Return a sensible hash for in case of recursion [ruby-core:24648] * range.c (rb_range_hash): ditto * struct.c (rb_struct_hash): ditto * array.c (rb_array_hash): ditto * test/ruby/test_array.rb (test_hash2): test for above git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_hash): reject recursive key.akr2009-07-171-3/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_join): raise ArgumentError for joiningmatz2009-07-171-2/+2
| | | | | | | | | | | recursive array. * array.c (ary_join_1): ditto. * test/ruby/test_array.rb (TestArray#test_join2): test updated for recursive join. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_join_1): should recurse for element array.nobu2009-07-101-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_join2): fixed typo.nobu2009-07-101-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (recursive_join): use obj to tell if recursion occurs.nobu2009-07-101-0/+5
| | | | | | | | | [ruby-core:24150] * enum.c (enum_join): reverted r23966. [ruby-core:24196] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_flatten_bang): returns nil if nothing changed.nobu2009-05-071-0/+3
| | | | | | | a patch from Marc-Andre Lafortune in [ruby-core:23382]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): negative sample number is invalid.nobu2009-05-071-0/+2
| | | | | | | [ruby-core:23374] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_flatten): flatten(0) works as Array#dup.mame2009-04-151-0/+5
| | | | | | | | | [ruby-core:23168] * test/ruby/test_array.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-17/+17
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: fix wrong test, and add a test formame2009-03-041-1/+7
| | | | | | | sort_by!. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: add some tests for coverage.mame2009-03-041-0/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_uniq_bang, rb_ary_uniq): unique by the result ofnobu2009-02-141-0/+9
| | | | | | given block. [ruby-dev:37998] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (take_items): to_ary() raises ArgumentError if cannot tousa2009-01-211-2/+5
| | | | | | | | convert to Array. [ruby-dev:37797] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (take_items), enum.c (enum_zip): tries to convert tonobu2009-01-191-0/+5
| | | | | | | array first. [ruby-core:21442] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_array_subclass) test for r20076.yugui2008-10-311-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): remove SEGV when replacing array withmame2008-10-291-0/+8
| | | | | | | | | embedded one during sort. * test/ruby/test_array.rb (test_sort!): add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: add some tests.mame2008-10-291-0/+29
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array (test_permutation): add a test that replacesmame2008-10-291-0/+5
| | | | | | | array during permutation. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_pack): use utf-8.nobu2008-10-291-1/+1
| | | | | | | * test/ruby/test_pack.rb (test_pack_U): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_sample): add tests for size ofmame2008-10-241-0/+17
| | | | | | | returned array and randomness. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (TestArray#test_join): should restorematz2008-10-241-2/+4
| | | | | | | | global variable after the test. [ruby-dev:36896] * test/ruby/test_hash.rb (TestHash#test_to_s): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/xmlrpc, lib/rexml, test/ruby/test_array.rb,mame2008-10-011-1/+1
| | | | | | | | test/ruby/test_unicode_escape.rb, test/scanf/test_scanf.rb, test/rss/rss-assertions.rb: fix indentation to remove warning. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * golf_prelude.rb, lib/set.rb (TC_Set#test_each),knu2008-08-131-1/+1
| | | | | | | | | | | | | test/readline/test_readline_history.rb (Readline#test_each__enumerator), test/ruby/test_array.rb (TestArray#test_collect), test/ruby/test_enumerator.rb (TestEnumerator#test_initialize): Enumerable::Enumerator is now called Enumerator. * lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use enum_for instead of hardcoding Enumerable::Enumerator. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_obj_untrusted): new method Object#untrusted?.shugo2008-08-131-10/+36
| | | | | | | | | | | | | | | (rb_obj_untrust): new method Object#untrust. (rb_obj_trust): new method Object#trust. * array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c, string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c, ruby.c, marshal.c: fixes for Object#untrusted?. * test/ruby/test_module.rb, test/ruby/test_array.rb, test/ruby/test_object.rb, test/ruby/test_string.rb, test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for Object#untrusted?. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): rename #choice to #sample. inmatz2008-08-111-2/+6
| | | | | | addition, sample takes optional argument, a la #first. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_aset): access with too big indexmame2008-06-301-2/+2
| | | | | | | raises not ArgumentError but IndexError now. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_count, count_all_i, Init_Enumerable),knu2008-05-291-0/+1
| | | | | | | | array.c (rb_ary_count): If no argument or block is given, count the number of all elements. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_nitems, Init_Array): Axe Array#nitems().knu2008-05-281-12/+0
| | | | | | | cf. [ruby-dev:34676]-[ruby-dev:34713] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (flatten): check if reentered. [ruby-dev:34798]nobu2008-05-221-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (flatten): check if reentered. [ruby-dev:34798]nobu2008-05-221-0/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: fix tests for 64bit CPU.mame2008-05-201-6/+16
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_enc_strlen_cr): need to set ENC_CODERANGE_7BIT ifmatz2008-05-201-1/+1
| | | | | | | | | | | | | | | | | search_nonascii() fails. [ruby-dev:34751] * string.c (rb_str_reverse): preserve coderange info if the receiver is 7bit string. * string.c (rb_str_reverse_bang): ditto. * string.c (rb_str_reverse_bang): should have called single_byte_optimizable before rb_str_modify() that clears coderange info. * string.c (tr_trans): handle single bytes more eagerly. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): should not free shared pointer, and setnobu2008-05-171-0/+10
| | | | | | | shared. [ruby-dev:34732] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_count): Override Enumerable#count for betterknu2008-05-141-0/+8
| | | | | | | performance. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io_m17n.rb: remove a duplicative method.mame2008-05-131-1/+1
| | | | | | | | | | | | | | | | | | | * test/ruby/test_utf16.rb: rename a conflicting method name. * test/ruby/test_array.rb: ditto. * test/ruby/test_file_exhaustive.rb: ditto. * test/ruby/test_hash.rb: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_rational.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_sort_with_callcc): test for [ruby-core:16679].nobu2008-05-081-0/+19
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test for [ruby-dev:34581].akr2008-05-031-0/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix setup method.akr2008-04-191-4/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: add tests to achieve over 95% test coveragemame2008-04-181-0/+267
| | | | | | | of array.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_new): fix size check. [ruby-dev:34123]mame2008-03-251-0/+4
| | | | | | | | | | | | * array.c (rb_ary_take, rb_ary_drop): check negative size and use NUM2LONG instead of FIX2LONG. [ruby-dev:34123] * enum.c (enum_take, enum_drop): check negative size. * test/ruby/test_array.rb: add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_take, rb_ary_take_while, rb_ary_drop,mame2008-03-171-0/+16
| | | | | | | | | rb_ary_drop_while): new method. [ruby-dev:34067] * test/ruby/test_array.rb: add tests for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_slice_bang): If an invalid range is given, doknu2007-12-101-0/+16
| | | | | | | not raise an exception but return nil just like slice() does. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_product): generalized product, now takesmatz2007-10-021-0/+6
| | | | | | | arbitrary number of arrays. a patch from David Flanagan <david AT davidflanagan.com>. [ruby-core:12346] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_permutation): implementation contributed frommatz2007-10-011-8/+16
| | | | | | | | | David Flanagan. [ruby-core:12344] * array.c (rb_ary_combination): RDoc update to clarify. a patch from David Flanagan. [ruby-core:12344] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_combination): revisit #combination behavior.matz2007-10-011-2/+2
| | | | | | suggested by David Flanagan. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_combination): new method to give all combinationmatz2007-09-291-0/+22
| | | | | | | | | | | | | of elements from an array. [ruby-list:42671] * array.c (rb_ary_product): a new method to get all combinations of elements from two arrays. can be extended to combinations of n-arrays, e.g. a.product(b,c,d). anyone volunteer? * array.c (rb_ary_permutation): empty function body to calculate permutations of array elements. need volunteer. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for [ruby-dev:31197].akr2007-07-131-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e