summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-17 06:37:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-17 06:37:05 +0000
commit13b3abb227789ae6db0bf0a225e6c5db65b45f22 (patch)
treef4599221808fb31b86e821ce4f1fe82958099203 /test
parente2a87e8bc32c4c8797293281c4c82ed2e645124a (diff)
test_range.rb: add Range#new test
* test/ruby/test_range.rb (test_first_last): Add test for `Range.new`. [Fix GH-971] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_range.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 9b8bdca6e3..e544caf984 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -4,6 +4,12 @@ require 'timeout'
require 'bigdecimal'
class TestRange < Test::Unit::TestCase
+ def test_new
+ assert_equal((0..2), Range.new(0, 2))
+ assert_equal((0..2), Range.new(0, 2, false))
+ assert_equal((0...2), Range.new(0, 2, true))
+ end
+
def test_range_string
# XXX: Is this really the test of Range?
assert_equal([], ("a" ... "a").to_a)