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

merges r20452 from trunk into ruby_1_9_1.

* test/ruby/test_range.rb: add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2008-12-04 05:19:44 +00:00
parent 27fbb1ea85
commit c89703cac0
2 changed files with 13 additions and 0 deletions

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