diff options
author | Jeremy Evans <[email protected]> | 2021-02-26 12:14:48 -0800 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2022-08-11 08:47:29 -0700 |
commit | 49517b3bb436456407e0ee099c7442f3ab5ac53d (patch) | |
tree | 4ad9277c468e5961883264082618a67b14484abe /test/ruby/test_string.rb | |
parent | c361cf44c03275405989022054d7c20efcc2a2ce (diff) |
Fix inspect for unicode codepoint 0x85
This is an inelegant hack, by manually checking for this specific
code point in rb_str_inspect. Some testing indicates that this is
the only code point affected.
It's possible a better fix would be inside of lower-level encoding
code, such that rb_enc_isprint would return false and not true for
codepoint 0x85.
Fixes [Bug #16842]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4229
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index d37924dec1..ab14a3c17b 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -2614,6 +2614,11 @@ CODE assert_equal '"\x0012"', s.inspect, bug8290 end + def test_inspect_next_line + bug16842 = '[ruby-core:98231]' + assert_equal '"\\u0085"', 0x85.chr(Encoding::UTF_8).inspect, bug16842 + end + def test_partition assert_equal(%w(he l lo), S("hello").partition(/l/)) assert_equal(%w(he l lo), S("hello").partition("l")) |