Skip to content

Commit

Permalink
Use .b instead of force_encoding(Encoding::ASCII_8BIT)
Browse files Browse the repository at this point in the history
  • Loading branch information
shugo committed Jul 10, 2024
1 parent 60656a9 commit 2882475
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/textbringer/test_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1762,10 +1762,8 @@ def test_binary
end
buffer.beginning_of_buffer
buffer.forward_char(0xe3)
assert_equal((+"\xe3").force_encoding(Encoding::ASCII_8BIT),
buffer.byte_after)
assert_equal((+"\xe3").force_encoding(Encoding::ASCII_8BIT),
buffer.char_after)
assert_equal((+"\xe3").b, buffer.byte_after)
assert_equal((+"\xe3").b, buffer.char_after)
buffer = Buffer.new(data, file_encoding: "ascii-8bit")
assert_equal(true, buffer.binary?)
end
Expand Down

0 comments on commit 2882475

Please sign in to comment.