re.c: fixed escaped multibyte char

* re.c (unescape_nonascii): escaped multibyte character should be
  copied as-is, just with checking if the encoding matches.
  https://twitter.com/sakuro/status/972014409986883584

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-11 00:05:12 +00:00
parent 724878c913
commit 5fade63482
2 changed files with 14 additions and 0 deletions

View file

@ -515,6 +515,8 @@ class TestRegexp < Test::Unit::TestCase
s = ".........."
5.times { s.sub!(".", "") }
assert_equal(".....", s)
assert_equal("\\\u{3042}", Regexp.new("\\\u{3042}").source)
end
def test_equal