summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_array.rb
Commit message (Collapse)AuthorAgeFilesLines
* * 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
* * Merge YARVko12006-12-311-17/+1022
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (test_misc): added some testsocean2005-11-201-0/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_fill): tail elements were vanished when the middleocean2005-11-151-0/+23
| | | | | | | | | part of array was filled. (ie: [0,1,2,3,4].fill(-1,2,1) => [0,1,-1]) * test/ruby/test_array.rb (test_fill): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: add test for find_all. (based on Daniel Berger's ↵ocean2005-05-131-0/+10
| | | | | | patch) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add extend testcase for #first, #last, #shift, #unshift, #pop, #push methods.michal2004-06-161-0/+28
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: use local variables instead of a globalnobu2004-06-161-49/+49
| | | | | | | variable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/*: should not depend on $KCODE.nahi2004-02-181-2/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse.rb (OptionParser#order, #permute, #parse): allow annobu2003-09-051-43/+43
| | | | | | | | | | array as argument. * test/ruby/test_*.rb: moved invariants to left side in assert_equal, and use assert_nil, assert_raises and so on. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'nahi2003-09-051-33/+33
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby: tests for ruby itself.nahi2003-09-041-0/+103
* test/ruby/test_*.rb: split sample/test.rb into 28 test/unit testcases. some tests could not be translates... search '!!' mark to see it. * test/csv/test_csv.rb: should require 'csv', not '../lib/csv'. test runner should set load path correctly. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e