[前][次][番号順一覧][スレッド一覧]

ruby-changes:56055

From: Nobuyoshi <ko1@a...>
Date: Sun, 9 Jun 2019 12:30:38 +0900 (JST)
Subject: [ruby-changes:56055] Nobuyoshi Nakada: a8ef498d6b (trunk): Add tests of the encoding with BOM

https://git.ruby-lang.org/ruby.git/commit/?id=a8ef498d6b

From a8ef498d6bfbd5c665b75a0782526d18b361dd5b Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 9 Jun 2019 11:10:34 +0900
Subject: Add tests of the encoding with BOM


diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index 8dfa5d5..4cc3d15 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -2089,11 +2089,11 @@ EOT https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io_m17n.rb#L2089
         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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]