summaryrefslogtreecommitdiff
path: root/test/ruby/test_econv.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-14 06:40:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-14 06:40:55 +0000
commitc81b224edca453ed8ea3030cc74b2ede5ac9e63a (patch)
tree91fad68f293185c4ac2ee01e568b91896ae04bb9 /test/ruby/test_econv.rb
parentfcb4ab8d1c917b3f2a998f9b6eab3d9cec27670a (diff)
test: use String#b instead of dup.force_encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r--test/ruby/test_econv.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index f423ebfc9e..073355f319 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -3,12 +3,8 @@ require 'test/unit'
class TestEncodingConverter < Test::Unit::TestCase
def check_ec(edst, esrc, eres, dst, src, ec, off, len, opts=nil)
res = ec.primitive_convert(src, dst, off, len, opts)
- assert_equal([edst.dup.force_encoding("ASCII-8BIT"),
- esrc.dup.force_encoding("ASCII-8BIT"),
- eres],
- [dst.dup.force_encoding("ASCII-8BIT"),
- src.dup.force_encoding("ASCII-8BIT"),
- res])
+ assert_equal([edst.b, esrc.b, eres],
+ [dst.b, src.b, res])
end
def assert_econv(converted, eres, obuf_bytesize, ec, consumed, rest, opts=nil)
@@ -22,8 +18,8 @@ class TestEncodingConverter < Test::Unit::TestCase
def assert_errinfo(e_res, e_enc1, e_enc2, e_error_bytes, e_readagain_bytes, ec)
assert_equal([e_res, e_enc1, e_enc2,
- e_error_bytes && e_error_bytes.dup.force_encoding("ASCII-8BIT"),
- e_readagain_bytes && e_readagain_bytes.dup.force_encoding("ASCII-8BIT")],
+ e_error_bytes && e_error_bytes.b,
+ e_readagain_bytes && e_readagain_bytes.b],
ec.primitive_errinfo)
end