diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-16 22:43:48 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-16 22:43:48 +0000 |
commit | b21088b431e03d15032caad160888e16b8f2198b (patch) | |
tree | ff4bb389c1b7c2032eaccd0f8e7a595e9815e186 /test | |
parent | 9166dd9ec7189376a9c1cb3dda2e40628096d015 (diff) | |
download | ruby-b21088b431e03d15032caad160888e16b8f2198b.tar.gz |
* string.c (rb_str_upto): generate numerical sequence when
characters in both edges are all digits. [ruby-talk:343186]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_range.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_range.rb b/test/ruby/test_range.rb index 9dfd29012a..017a8cb71a 100644 --- a/test/ruby/test_range.rb +++ b/test/ruby/test_range.rb @@ -9,6 +9,12 @@ class TestRange < Test::Unit::TestCase assert_equal(["a", "b"], ("a" .. "b").to_a) end + def test_range_numeric_string + assert_equal(["6", "7", "8"], ("6".."8").to_a, "[ruby-talk:343187]") + assert_equal(["6", "7"], ("6"..."8").to_a) + assert_equal(["9", "10"], ("9".."10").to_a) + end + def test_evaluation_order arr = [1,2] r = (arr.shift)..(arr.shift) |