summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-17 23:41:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-17 23:41:44 +0000
commit1d4d4dab7c6883b070208ac5de05d1a5163e5b4d (patch)
tree300e11fda0bc457cf727dc41f00be554431fbb6b /test
parentfec2c47eba629132adbebbdc2343ebbff3703439 (diff)
downloadruby-1d4d4dab7c6883b070208ac5de05d1a5163e5b4d.tar.gz
ruby-1d4d4dab7c6883b070208ac5de05d1a5163e5b4d.tar.xz
ruby-1d4d4dab7c6883b070208ac5de05d1a5163e5b4d.zip
* string.c (str_utf8_nth): fixed overrun. [ruby-core:26787]
?\012 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_m17n.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 1fa6d5128..e5c0acb03 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -867,6 +867,11 @@ class TestM17N < Test::Unit::TestCase
assert_equal(nil, u("\xc2\xa1\xc2\xa2\xc2\xa3")[u("\xa1\xc2")])
assert_raise(Encoding::CompatibilityError) { u("\xc2\xa1\xc2\xa2\xc2\xa3")[a("\xa1\xc2")] }
assert_nil(e("\xa1\xa2\xa3\xa4")[e("\xa2\xa3")])
+
+ bug2379 = '[ruby-core:26787]'
+ assert_equal("\u{439}", "\u{439}"[0, 30], bug2379)
+ assert_equal("\u{439}", "a\u{439}"[1, 30], bug2379)
+ assert_equal("\u{439}", "a\u{439}bcdefghijklmnop"[1, 1][0, 1], bug2379)
end
def test_aset