summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-17 17:00:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-17 17:00:47 +0000
commit95e77269a9495c9f72b361a148fa45312c5a609c (patch)
treecd2950fed201e598e4c52fca8ba92ed67dde5f4d /test/ruby
parent0ff29a4fc1074fd9cef7dbc6b63ff91c55131140 (diff)
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_range.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb
index 94e6583d22..69eba88455 100644
--- a/test/ruby/test_range.rb
+++ b/test/ruby/test_range.rb
@@ -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)