mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test for chomp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b9c18bdcdd
commit
3970d67185
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue