diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-13 02:33:11 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-13 02:33:11 +0000 |
| commit | e3352e1b15a20301c65d035b9c8659c3b712753a (patch) | |
| tree | f0ddec7c3c14aad37dbd4cbfbcee38483430c3ee /test/ruby | |
| parent | 5a0d9bd43fd28e7691c11921a0327134364ba8c0 (diff) | |
| download | ruby-e3352e1b15a20301c65d035b9c8659c3b712753a.tar.gz ruby-e3352e1b15a20301c65d035b9c8659c3b712753a.tar.xz ruby-e3352e1b15a20301c65d035b9c8659c3b712753a.zip | |
* range.c (range_max, range_min): return nil for empty set as well as
1.8 and Enumerable. [ruby-dev:31198]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_range.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 3c24215c6..030aeb977 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -40,6 +40,9 @@ class TestRange < Test::Unit::TestCase assert_equal(1.0, (1.0..2.0).min) assert_equal(nil, (2.0..1.0).min) assert_equal(1, (1.0...2.0).min) + + assert_equal(0, (0..0).min) + assert_equal(nil, (0...0).min) end def test_max @@ -52,5 +55,8 @@ class TestRange < Test::Unit::TestCase assert_raise(TypeError) { (1.0...2.0).max } assert_equal(-0x80000002, ((-0x80000002)...(-0x80000001)).max) + + assert_equal(0, (0..0).max) + assert_equal(nil, (0...0).max) end end |
