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

ruby-changes:39195

From: nobu <ko1@a...>
Date: Fri, 17 Jul 2015 15:37:10 +0900 (JST)
Subject: [ruby-changes:39195] nobu:r51276 (trunk): test_range.rb: add Range#last assertions

nobu	2015-07-17 15:36:42 +0900 (Fri, 17 Jul 2015)

  New Revision: 51276

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

  Log:
    test_range.rb: add Range#last assertions
    
    * test/ruby/test_range.rb (test_first_last): Add assertions to
      test of `Range#last` with exclude_end true case.  [Fix GH-970]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_range.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51275)
+++ ChangeLog	(revision 51276)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jul 17 15:36:40 2015  yui-knk  <spiketeika@g...>
+
+	* test/ruby/test_range.rb (test_first_last): Add assertions to
+	  test of `Range#last` with exclude_end true case.  [Fix GH-970]
+
 Fri Jul 17 09:59:14 2015  Eric Wong  <e@8...>
 
 	* thread.c (rb_thread_alone): simplify
Index: test/ruby/test_range.rb
===================================================================
--- test/ruby/test_range.rb	(revision 51275)
+++ test/ruby/test_range.rb	(revision 51276)
@@ -265,7 +265,10 @@ class TestRange < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_range.rb#L265
     assert_equal([0, 1, 2], (0...10).first(3))
     assert_equal([7, 8, 9], (0...10).last(3))
     assert_equal(0, (0...10).first)
+    assert_equal(10, (0...10).last)
     assert_equal("a", ("a"..."c").first)
+    assert_equal("c", ("a"..."c").last)
+    assert_equal(0, (2...0).last)
   end
 
   def test_to_s

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

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