summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-09 11:10:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-09 11:11:26 +0900
commita8ef498d6bfbd5c665b75a0782526d18b361dd5b (patch)
treee68ffde0681ca5c5408380fbb290c78333cdce63 /test
parentf42588f754d5885ec30631e5008c383f3ef905d8 (diff)
Add tests of the encoding with BOM
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io_m17n.rb8
1 files changed, 4 insertions, 4 deletions
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]'