1
0
Fork 0
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:
matz 2008-02-29 13:33:26 +00:00
parent daa622aed0
commit 2d97d3ddac
4 changed files with 86 additions and 31 deletions

View file

@ -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