diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-16 02:05:37 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-16 02:05:37 +0000 |
commit | 0a08782b12b384aea0ea5bf8921d8976931cb11f (patch) | |
tree | 064b56c82fc5223920205295bc7e9e4bcf0688c5 /test | |
parent | eb0761408524b45266940fc02c86cf3a0f5b87af (diff) |
merge revision(s) 49058: [Backport #10670]
* 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/branches/ruby_2_2@49264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_m17n.rb | 9 |
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 |