Skip to content

Commit

Permalink
Improve encoding test
Browse files Browse the repository at this point in the history
  • Loading branch information
lloeki committed Nov 20, 2024
1 parent 725aab3 commit 6554cab
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/engines/test_encoding.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
require 'minitest/autorun'
require "minitest/autorun"

class TestEncoding < Minitest::Test
def test_utf8
assert_equal("".encoding, Encoding::UTF_8)
def test_utf8_lang
assert_equal("en_US.UTF-8", ENV["LANG"])
end

def test_utf8_string
assert_equal(Encoding::UTF_8, "".encoding)
end

def test_read_utf8
contents = File.read('test/fixtures/encoding/utf-8.txt')
assert_equal(contents.encoding, Encoding::UTF_8)
assert_equal(contents, "\u2705\n")
contents = File.read("test/fixtures/encoding/utf-8.txt")

assert_equal(Encoding::UTF_8, contents.encoding)
assert_equal("\u2705\n", contents)
end
end

0 comments on commit 6554cab

Please sign in to comment.