Use Encoding.default_external for tests of Readline::HISTORY

This commit is contained in:
aycabta 2021-06-21 19:31:14 +09:00
parent 30cc07fdc1
commit 089a26b0a6

View File

@ -244,11 +244,11 @@ module BasetestReadlineHistory
def assert_external_string_equal(expected, actual) def assert_external_string_equal(expected, actual)
assert_equal(expected, actual) assert_equal(expected, actual)
assert_equal(get_default_internal_encoding, actual.encoding) assert_equal(get_default_encoding, actual.encoding)
end end
def get_default_internal_encoding def get_default_encoding
return Encoding.default_internal || Encoding.find("locale") return Encoding.default_external || Encoding.find("locale")
end end
end end
@ -277,7 +277,7 @@ class TestRelineAsReadlineHistory < Test::Unit::TestCase
super super
end end
def get_default_internal_encoding def get_default_encoding
if RUBY_PLATFORM =~ /mswin|mingw/ if RUBY_PLATFORM =~ /mswin|mingw/
Encoding.default_internal || Encoding::UTF_8 Encoding.default_internal || Encoding::UTF_8
else else