aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-29 09:58:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-29 09:58:48 +0000
commit316210b80bd0afff27be5925dbf5521982bebe93 (patch)
treea061a97dbcc5ab2923f16cc7d351cb9b05fa8a18 /test/ruby/test_m17n.rb
parentd1e65737f65b984ca4d3970d0fe984745db80554 (diff)
downloadruby-316210b80bd0afff27be5925dbf5521982bebe93.tar.gz
re.c: append excape sequence as-is
* re.c (unescape_nonascii): append excape sequence as-is not unescaped character, to get rid of unexpected meta-character. [ruby-core:67193] [Bug #10670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 99450723cf..99a6b3130f 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1579,4 +1579,13 @@ class TestM17N < Test::Unit::TestCase
assert_same(str, str.scrub!)
assert_equal("\uFFFD\uFFFD\uFFFD", str)
end
+
+ def test_escaped_metachar
+ bug10670 = '[ruby-core:67193] [Bug #10670]'
+
+ escape_plain = /\A[\x5B]*\z/.freeze
+
+ assert_match(escape_plain, 0x5b.chr(::Encoding::UTF_8), bug10670)
+ assert_match(escape_plain, 0x5b.chr, bug10670)
+ end
end