mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_str_chomp_bang): now works on UTF-16.
* string.c (tr_setup_table): negation should work on non ASCII compatible strings as well. * string.c (rb_str_split_m): awk split should work on non ASCII compatible strings as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
daa622aed0
commit
2d97d3ddac
4 changed files with 86 additions and 31 deletions
|
@ -232,9 +232,11 @@ EOT
|
|||
|
||||
def test_chomp
|
||||
s = "\1\n".force_encoding("utf-16be")
|
||||
assert_raise(ArgumentError, "#{encdump s}.chomp") {
|
||||
s.chomp
|
||||
}
|
||||
assert_equal(s, s.chomp, "#{encdump s}.chomp")
|
||||
s = "\0\n".force_encoding("utf-16be")
|
||||
assert_equal("", s.chomp, "#{encdump s}.chomp")
|
||||
s = "\0\r\0\n".force_encoding("utf-16be")
|
||||
assert_equal("", s.chomp, "#{encdump s}.chomp")
|
||||
end
|
||||
|
||||
def test_succ
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue