Skip to content

Commit

Permalink
Replace Reline::IOGate.encoding with Reline.core.encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Jul 5, 2023
1 parent b025a5c commit fb0933a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/reline/test_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def assert_external_string_equal(expected, actual)
end

def get_default_internal_encoding
if encoding = Reline::IOGate.encoding
if encoding = Reline.core.encoding
encoding
elsif RUBY_PLATFORM =~ /mswin|mingw/
Encoding.default_internal || Encoding::UTF_8
Expand Down
6 changes: 3 additions & 3 deletions test/reline/test_key_actor_emacs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup
@config.autocompletion = false
Reline::HISTORY.instance_variable_set(:@config, @config)
Reline::HISTORY.clear
@encoding = Reline::IOGate.encoding
@encoding = Reline.core.encoding
@line_editor = Reline::LineEditor.new(@config, @encoding)
@line_editor.reset(@prompt, encoding: @encoding)
end
Expand Down Expand Up @@ -2167,7 +2167,7 @@ def test_ed_search_next_history_with_empty

# Unicode emoji test
def test_ed_insert_for_include_zwj_emoji
omit "This test is for UTF-8 but the locale is #{Reline::IOGate.encoding}" if Reline::IOGate.encoding != Encoding::UTF_8
omit "This test is for UTF-8 but the locale is #{Reline.core.encoding}" if Reline.core.encoding != Encoding::UTF_8
# U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466 is family: man, woman, girl, boy "👨‍👩‍👧‍👦"
input_keys("\u{1F468}") # U+1F468 is man "👨"
assert_line("\u{1F468}")
Expand Down Expand Up @@ -2213,7 +2213,7 @@ def test_ed_insert_for_include_zwj_emoji
end

def test_ed_insert_for_include_valiation_selector
omit "This test is for UTF-8 but the locale is #{Reline::IOGate.encoding}" if Reline::IOGate.encoding != Encoding::UTF_8
omit "This test is for UTF-8 but the locale is #{Reline.core.encoding}" if Reline.core.encoding != Encoding::UTF_8
# U+0030 U+FE00 is DIGIT ZERO + VARIATION SELECTOR-1 "0︀"
input_keys("\u0030") # U+0030 is DIGIT ZERO
assert_line("\u0030")
Expand Down
2 changes: 1 addition & 1 deletion test/reline/test_key_actor_vi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def setup
@config.read_lines(<<~LINES.split(/(?<=\n)/))
set editing-mode vi
LINES
@encoding = Reline::IOGate.encoding
@encoding = Reline.core.encoding
@line_editor = Reline::LineEditor.new(@config, @encoding)
@line_editor.reset(@prompt, encoding: @encoding)
end
Expand Down
2 changes: 1 addition & 1 deletion test/reline/test_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Reline::MacroTest < Reline::TestCase
def setup
Reline.send(:test_mode)
@config = Reline::Config.new
@encoding = Reline::IOGate.encoding
@encoding = Reline.core.encoding
@line_editor = Reline::LineEditor.new(@config, @encoding)
@line_editor.instance_variable_set(:@screen_size, [24, 80])
@output = @line_editor.output = File.open(IO::NULL, "w")
Expand Down
2 changes: 1 addition & 1 deletion test/reline/test_reline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def test_dumb_terminal
end

def get_reline_encoding
if encoding = Reline::IOGate.encoding
if encoding = Reline.core.encoding
encoding
elsif RUBY_PLATFORM =~ /mswin|mingw/
Encoding::UTF_8
Expand Down
2 changes: 1 addition & 1 deletion test/reline/test_string_processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def setup
@prompt = '> '
@config = Reline::Config.new
Reline::HISTORY.instance_variable_set(:@config, @config)
@encoding = Reline::IOGate.encoding
@encoding = Reline.core.encoding
@line_editor = Reline::LineEditor.new(@config, @encoding)
@line_editor.reset(@prompt, encoding: @encoding)
end
Expand Down

0 comments on commit fb0933a

Please sign in to comment.