aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 01:52:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 01:52:04 +0000
commitfa2334f9f1635bdd7d1c308e3c6b7970b166bc88 (patch)
tree7f666b1d36a8ee565687b97a169f7fdc8cb468cd /test/ruby/test_m17n.rb
parentb8870bc0451b55561d92af43f17761b086a64709 (diff)
downloadruby-fa2334f9f1635bdd7d1c308e3c6b7970b166bc88.tar.gz
re.c: fix wchar match at EOS
* re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching till the end of string. [ruby-core:70592] [Bug #11488] * test/ruby/test_m17n.rb (test_include?, tet_index): add tests by Tom Stuart. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index eb2063ebea..6b89ad572d 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1066,6 +1066,10 @@ class TestM17N < Test::Unit::TestCase
assert_equal(false, e("\xa1\xa2\xa3\xa4").include?(e("\xa3")))
s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
assert_equal(false, s.include?(e("\xb0\xa3")))
+ bug11488 = '[ruby-core:70592] [Bug #11488]'
+ each_encoding("abcdef", "def") do |str, substr|
+ assert_equal(true, str.include?(substr), bug11488)
+ end
end
def test_index
@@ -1075,6 +1079,10 @@ class TestM17N < Test::Unit::TestCase
assert_nil(e("\xa1\xa2\xa3\xa4").rindex(e("\xa3")))
s = e("\xa3\xb0\xa3\xb1\xa3\xb2\xa3\xb3\xa3\xb4")
assert_raise(Encoding::CompatibilityError){s.rindex(a("\xb1\xa3"))}
+ bug11488 = '[ruby-core:70592] [Bug #11488]'
+ each_encoding("abcdef", "def") do |str, substr|
+ assert_equal(3, str.index(substr), bug11488)
+ end
end
def test_next