summaryrefslogtreecommitdiff
path: root/test/ruby/test_range.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_range.rb')
-rw-r--r--test/ruby/test_range.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index b1008d041f3..5d21d302575 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -443,6 +443,8 @@ class TestRange < Test::Unit::TestCase
assert_equal("a", ("a"..nil).first)
assert_raise(RangeError) { (0..nil).last }
assert_raise(RangeError) { (0..nil).last(3) }
+ assert_raise(RangeError) { (nil..0).first }
+ assert_raise(RangeError) { (nil..0).first(3) }
assert_equal([0, 1, 2], (0..10).first(3.0))
assert_equal([8, 9, 10], (0..10).last(3.0))