mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* range.c (range_step): treat symbols specially so that iterating
over symbols should work like strings. [ruby-core:24780] * range.c (range_each): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0ff29a4fc1
commit
95e77269a9
3 changed files with 52 additions and 0 deletions
|
@ -18,6 +18,10 @@ class TestRange < Test::Unit::TestCase
|
|||
assert_equal(["9", "10"], ("9"..SimpleDelegator.new("10")).to_a)
|
||||
end
|
||||
|
||||
def test_range_symbol
|
||||
assert_equal([:a, :b], (:a .. :b).to_a)
|
||||
end
|
||||
|
||||
def test_evaluation_order
|
||||
arr = [1,2]
|
||||
r = (arr.shift)..(arr.shift)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue