summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-22 03:56:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-22 03:56:26 +0000
commit1a95e46cc6194933cf75a4bf91a0bb6502f177a0 (patch)
tree9d5404fbb87c658942acae26830475e633f793b3 /test/ruby/test_m17n.rb
parent30f008a8e383f20e907ecd9c5f449f64d10eb6dc (diff)
string.c: fix wrong single-byte optimization
* string.c (rb_str_count): fix wrong single-byte optimization. 7bit ascii can be a trailing byte in Shift_JIS. [ruby-dev:48442] [Bug #10078] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-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 b9b85b2129..7d00b1aec6 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1037,6 +1037,11 @@ class TestM17N < Test::Unit::TestCase
assert_raise(Encoding::CompatibilityError){s.count(a("\xa3\xb0"))}
end
+ def test_count_sjis_trailing_byte
+ bug10078 = '[ruby-dev:48442] [Bug #10078]'
+ assert_equal(0, s("\x98\x61").count("a"), bug10078)
+ end
+
def test_delete
assert_equal(1, e("\xa1\xa2").delete("z").length)
s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")