ruby-changes:47074
From: duerst <ko1@a...>
Date: Wed, 28 Jun 2017 11:28:04 +0900 (JST)
Subject: [ruby-changes:47074] duerst:r59189 (trunk): add two tests
duerst 2017-06-28 11:28:00 +0900 (Wed, 28 Jun 2017) New Revision: 59189 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59189 Log: add two tests Modified files: trunk/test/ruby/test_transcode.rb Index: test/ruby/test_transcode.rb =================================================================== --- test/ruby/test_transcode.rb (revision 59188) +++ test/ruby/test_transcode.rb (revision 59189) @@ -1006,6 +1006,9 @@ class TestTranscode < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/ruby/test_transcode.rb#L1006 fffd5 = "\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\xBF".encode("utf-16be", "utf-8", invalid: :replace) assert_equal fffd2, "\xC1\x80".encode("utf-16be", "utf-8", invalid: :replace) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/