зеркало из https://github.com/github/ruby.git
add two tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ff36c25f47
Коммит
b3f38b57e7
|
@ -1006,6 +1006,9 @@ class TestTranscode < Test::Unit::TestCase
|
||||||
fffd5 = "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD".encode 'UTF-16BE'
|
fffd5 = "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD".encode 'UTF-16BE'
|
||||||
fffd6 = "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD".encode 'UTF-16BE'
|
fffd6 = "\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD".encode 'UTF-16BE'
|
||||||
|
|
||||||
|
assert_equal fffd1, "\x80".encode("utf-16be", "utf-8", invalid: :replace)
|
||||||
|
assert_equal fffd1, "\xBF".encode("utf-16be", "utf-8", invalid: :replace)
|
||||||
|
|
||||||
assert_equal fffd2, "\xC0\x80".encode("utf-16be", "utf-8", invalid: :replace)
|
assert_equal fffd2, "\xC0\x80".encode("utf-16be", "utf-8", invalid: :replace)
|
||||||
assert_equal fffd2, "\xC0\xBF".encode("utf-16be", "utf-8", invalid: :replace)
|
assert_equal fffd2, "\xC0\xBF".encode("utf-16be", "utf-8", invalid: :replace)
|
||||||
assert_equal fffd2, "\xC1\x80".encode("utf-16be", "utf-8", invalid: :replace)
|
assert_equal fffd2, "\xC1\x80".encode("utf-16be", "utf-8", invalid: :replace)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче