summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-17 06:36:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-17 06:36:42 +0000
commite2a87e8bc32c4c8797293281c4c82ed2e645124a (patch)
tree4afa30d6e4cddef7c306b1fb0e1af78d02157619 /test
parent3ee156c7a39af290104c842cafb13aa985ed28c5 (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_range.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 791764b355..9b8bdca6e3 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -265,7 +265,10 @@ class TestRange < Test::Unit::TestCase
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