diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-26 21:23:59 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-26 21:23:59 +0000 |
commit | 3970d67185c90e3c017f205ef3c73e192015bab0 (patch) | |
tree | 493ae07c68d0fb22b74a1e9028a4cd7d93c02657 /test | |
parent | b9c18bdcddcc1ab6dc08988436d99d61eb8f3d7f (diff) | |
download | ruby-3970d67185c90e3c017f205ef3c73e192015bab0.tar.gz |
add a test for chomp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 |