Skip to content

Commit

Permalink
Add tests of the encoding with BOM
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jun 9, 2019
1 parent f42588f commit a8ef498
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/ruby/test_io_m17n.rb
Expand Up @@ -2089,11 +2089,11 @@ def test_strip_bom
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]'
Expand Down

0 comments on commit a8ef498

Please sign in to comment.