mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
* re.c (rb_reg_expr_str): fix broken Regexp#inspect when it
is ASCII-8BIT and non-ASCII character. The length of character should be from original byte string. [ruby-core:31431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
24b17a2e87
commit
203ebcbb92
3 changed files with 11 additions and 3 deletions
|
@ -155,8 +155,8 @@ class TestRegexp < Test::Unit::TestCase
|
|||
assert_equal('/\/x/i', /\/x/i.inspect)
|
||||
assert_equal('/\x00/i', /#{"\0"}/i.inspect)
|
||||
assert_equal("/\n/i", /#{"\n"}/i.inspect)
|
||||
s = [0xff].pack("C")
|
||||
assert_equal('/\/\xFF/i', /\/#{s}/i.inspect)
|
||||
s = [0xf1, 0xf2, 0xf3].pack("C*")
|
||||
assert_equal('/\/\xF1\xF2\xF3/i', /\/#{s}/i.inspect)
|
||||
end
|
||||
|
||||
def test_char_to_option
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue