diff options
author | Lars Kanis <lars@greiz-reinsdorf.de> | 2020-01-18 21:22:24 +0100 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-01-21 21:26:58 +0900 |
commit | b0ca1fc21bbb9dac65a3b3f7b5935e691ece1501 (patch) | |
tree | 0127680ae58b77481f088bac020387e09b2a084d /test/reline/test_history.rb | |
parent | d1166c6d3942303b812c475129a84f1025b1db1f (diff) |
Reline: Fix changed test results due to change to UTF-8 on Windows
In commit f8ea2860b0cac1aec79978e6c44168802958e8af the Reline encoding
for native windows console was changed to hardcoded UTF-8.
This caused failures in reline and readline tests, but they were hidden,
because parallel ruby tests incorrectly used Reline::ANSI as IOGate.
Tests failures were raised in single process mode, but not with -j switch.
This patch corrects encodings on native Windows console.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2848
Diffstat (limited to 'test/reline/test_history.rb')
-rw-r--r-- | test/reline/test_history.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/reline/test_history.rb b/test/reline/test_history.rb index 260b6e8528..13d3d2f90b 100644 --- a/test/reline/test_history.rb +++ b/test/reline/test_history.rb @@ -268,6 +268,10 @@ class Reline::History::Test < Reline::TestCase end def get_default_internal_encoding - return Encoding.default_internal || Encoding.find("locale") + if RUBY_PLATFORM =~ /mswin|mingw/ + Encoding.default_internal || Encoding::UTF_8 + else + Encoding.default_internal || Encoding.find("locale") + end end end |