From a8ef498d6bfbd5c665b75a0782526d18b361dd5b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 9 Jun 2019 11:10:34 +0900 Subject: Add tests of the encoding with BOM --- test/ruby/test_io_m17n.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/ruby/test_io_m17n.rb') diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 8dfa5d5500..4cc3d15f3d 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2089,11 +2089,11 @@ EOT content = text.encode(name) generate_file(path, content) result = File.read(path, mode: 'rb:BOM|UTF-8') - assert_equal(content[1].force_encoding("ascii-8bit"), - result.force_encoding("ascii-8bit")) + assert_equal(Encoding.find(name), result.encoding, name) + assert_equal(content[1..-1].b, result.b, name) result = File.read(path, mode: 'rb:BOM|UTF-8:UTF-8') - assert_equal(Encoding::UTF_8, result.encoding) - assert_equal(stripped, result) + assert_equal(Encoding::UTF_8, result.encoding, name) + assert_equal(stripped, result, name) end bug3407 = '[ruby-core:30641]' -- cgit v1.2.3