From 2d97d3ddac90777a9df4edea9c445155e42f30b7 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 29 Feb 2008 13:33:26 +0000 Subject: * 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 --- test/ruby/test_utf16.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/ruby/test_utf16.rb') diff --git a/test/ruby/test_utf16.rb b/test/ruby/test_utf16.rb index 1647563f84..74ddcf752e 100644 --- a/test/ruby/test_utf16.rb +++ b/test/ruby/test_utf16.rb @@ -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 -- cgit v1.2.3