[前][次][番号順一覧][スレッド一覧]

ruby-changes:31211

From: nobu <ko1@a...>
Date: Tue, 15 Oct 2013 16:34:09 +0900 (JST)
Subject: [ruby-changes:31211] nobu:r43290 (trunk): test_array.rb: add test

nobu	2013-10-15 16:34:03 +0900 (Tue, 15 Oct 2013)

  New Revision: 43290

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43290

  Log:
    test_array.rb: add test
    
    * test/ruby/test_array.rb (test_last2): add test for Array#last with
      length argument.

  Modified files:
    trunk/test/ruby/test_array.rb
Index: test/ruby/test_array.rb
===================================================================
--- test/ruby/test_array.rb	(revision 43289)
+++ test/ruby/test_array.rb	(revision 43290)
@@ -1794,6 +1794,11 @@ class TestArray < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_array.rb#L1794
     assert_raise(ArgumentError) { [0].first(-1) }
   end
 
+  def test_last2
+    assert_equal([0], [0].last(2))
+    assert_raise(ArgumentError) { [0].last(-1) }
+  end
+
   def test_shift2
     assert_equal(0, ([0] * 16).shift)
     # check

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]