1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

14 commits

Author SHA1 Message Date
nobu
c6b1f4ad06 * test/ruby/test_array.rb: suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16 00:21:49 +00:00
knu
14dd72b35a * enum.c (count_i, count_iter_i): Sync with trunk.
enum.c (enum_count, count_all_i, Init_Enumerable),
  array.c (rb_ary_count): Sync with trunk.  If no argument or
  block is given, count the number of all elements.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29 19:35:04 +00:00
nobu
0ba197f08f * array.c (flatten): check if reentered. [ruby-dev:34798]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 05:20:59 +00:00
knu
d007e7d20f * array.c (rb_ary_count): Override Enumerable#count for better
performance.
  (rb_ary_nitems): Undo the backport.  Use #count {} instead.

* enumerator.c (enumerator_iter_i): Remove an unused function.
  (enumerator_with_index, enumerator_each): Remove unused
  variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-14 10:26:48 +00:00
knu
f2dc726691 * array.c (rb_ary_flatten, rb_ary_flatten_bang): Take an optional
argument that determines the level of recursion to flatten;
  backported from 1.9.

* array.c (rb_ary_shuffle_bang, rb_ary_shuffle, rb_ary_choice,
  rb_ary_cycle, rb_ary_permutation, rb_ary_combination,
  rb_ary_product, rb_ary_take, rb_ary_take_while, rb_ary_drop,
  rb_ary_drop_while): New methods: Array#shuffle, #shuffle!,
  #choice, #cycle, #permutation, #combination, #product, #take,
  #take_while, #drop, #drop_while; backported from 1.9.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 11:03:42 +00:00
knu
b0388e77e3 * array.c (rb_ary_slice_bang): If an invalid negative index (<=
-size) is given, do not raise an exception but return nil just
  like slice() does.

* test/ruby/test_array.rb (TestArray::test_slice,
  TestArray::test_slice!): Pull in test cases from trunk.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10 15:08:31 +00:00
ocean
1ec7274fd9 * test/ruby/test_array.rb (test_misc): added some tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-20 01:26:39 +00:00
ocean
518851f88d * array.c (rb_ary_fill): tail elements were vanished when the middle
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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-15 07:06:00 +00:00
ocean
8d773f686e * test/ruby/test_array.rb: add test for find_all. (based on Daniel Berger's patch)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-13 05:24:19 +00:00
nobu
f5b3969eda * test/ruby/test_array.rb: use local variables instead of a global
variable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-16 09:20:36 +00:00
nahi
688ec3f8ee * test/*: should not depend on $KCODE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-18 13:21:10 +00:00
nobu
44785befea * lib/optparse.rb (OptionParser#order, #permute, #parse): allow an
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-05 15:15:43 +00:00
nahi
65264eadbd * test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-05 11:28:27 +00:00
nahi
aaf5d9c03c * test/ruby: tests for ruby itself.
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-04 16:18:59 +00:00