summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-03 15:16:55 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-03 15:16:55 +0000
commita1fc9cd5829d6c00f6cc4afd57f2a9b09a185046 (patch)
tree3b44257bdccbbdbb379406c5e2f7ab300b809428 /test/ruby
parent2c2fb9c5ec1dff9b1dc4d53a78502fef2132e39d (diff)
* string.c (rb_str_upto): make next object before yield its block.
fix: can modify original begin string of String#upto. [ruby-dev:26384] [ruby-dev:39626] #2327 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_string.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 290f53634d..27360e76c1 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -1602,6 +1602,17 @@ class TestString < Test::Unit::TestCase
assert_equal(24, count, "[ruby-dev:39361]")
end
+ def test_upto_nonalnum
+ first = S("\u3041")
+ last = S("\u3093")
+ count = 0
+ assert_equal(first, first.upto(last) {|s|
+ count += 1
+ s.replace(last)
+ })
+ assert_equal(83, count, "[ruby-dev:39626]")
+ end
+
def test_mod_check
assert_raise(RuntimeError) {
s = ""