diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_utf16.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_utf16.rb b/test/ruby/test_utf16.rb index aeb9cea133..485a926db1 100644 --- a/test/ruby/test_utf16.rb +++ b/test/ruby/test_utf16.rb @@ -37,6 +37,14 @@ class TestUTF16 < Test::Unit::TestCase result end + def assert_str_equal(expected, actual, message=nil) + full_message = build_message(message, <<EOT) +#{encdump expected} expected but not equal to +#{encdump actual}. +EOT + assert_block(full_message) { expected == actual } + end + # tests start def test_utf16be_valid_encoding @@ -112,6 +120,11 @@ class TestUTF16 < Test::Unit::TestCase } end + def test_chomp + s = "\1\n".force_encoding("utf-16be") + assert_str_equal(s, s.chomp, "#{encdump s}.chomp") + end + def test_regexp_union enccall(Regexp, :union, "aa".force_encoding("utf-16be"), "bb".force_encoding("utf-16be")) end |