diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-02 17:53:48 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-02 17:53:48 +0000 |
commit | 181ffea5e040705d03603365ca5527d9e0676c5d (patch) | |
tree | e59b1046120e524991fad303e27f8541175fc93f /test | |
parent | 0863013b967b5d9c97c739a0311c3c0d9a3f6b5f (diff) | |
download | ruby-181ffea5e040705d03603365ca5527d9e0676c5d.tar.gz |
* test/ruby/test_range.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_range.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 81be101857..b4c078915d 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -267,4 +267,13 @@ class TestRange < Test::Unit::TestCase def o.end; 0; end assert_equal([], [0, 1, 2][o]) end + + class CyclicRange < Range + def <=>(other); true; end + end + def test_cyclic_range_inspect + o = CyclicRange.allocate + o.instance_eval { initialize(o, 1) } + assert_equal("(... .. ...)..1", o.inspect) + end end |