diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-17 17:00:47 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-17 17:00:47 +0000 |
commit | 6e2f7bbbc97175793bdb868ac1f9b9704a71611b (patch) | |
tree | cd2950fed201e598e4c52fca8ba92ed67dde5f4d /test | |
parent | 3ff18b0fdedc1291ca57195a6a3def98b7c5bbb2 (diff) | |
download | ruby-6e2f7bbbc97175793bdb868ac1f9b9704a71611b.tar.gz ruby-6e2f7bbbc97175793bdb868ac1f9b9704a71611b.tar.xz ruby-6e2f7bbbc97175793bdb868ac1f9b9704a71611b.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@24573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_range.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 94e6583d2..69eba8845 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) |