1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
mame 2008-12-02 17:53:48 +00:00
parent 0863013b96
commit 181ffea5e0
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Wed Dec 3 02:53:24 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_range.rb: add a test.
Wed Dec 3 02:26:07 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/ruby/test_string.rb: add some tests.

View file

@ -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