summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-01-12 22:24:17 +0900
committeraycabta <aycabta@gmail.com>2020-01-14 15:40:38 +0900
commitf8ea2860b0cac1aec79978e6c44168802958e8af (patch)
treec34b0ee9cd9d6b2b7a4fc494d0f9563a7ce97968 /test
parentc94025b63091be5b5e83a2f5ab5dc8d6c6147b84 (diff)
Introduce an abstracted structure about the encoding of Reline
The command prompt on Windows always uses Unicode to take input and print output but most Reline implementation depends on Encoding.default_external. This commit introduces an abstracted structure about the encoding of Reline.
Diffstat (limited to 'test')
-rw-r--r--test/reline/test_key_actor_emacs.rb4
-rw-r--r--test/reline/test_key_actor_vi.rb4
-rw-r--r--test/reline/test_macro.rb3
-rw-r--r--test/reline/test_string_processing.rb4
4 files changed, 8 insertions, 7 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index 6de448fa03..7e97caad23 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -8,8 +8,8 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
Reline::HISTORY.instance_variable_set(:@config, @config)
Reline::HISTORY.clear
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
- @line_editor = Reline::LineEditor.new(@config)
- @line_editor.reset(@prompt, @encoding)
+ @line_editor = Reline::LineEditor.new(@config, @encoding)
+ @line_editor.reset(@prompt, encoding: @encoding)
end
def test_ed_insert_one
diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb
index 1ea160b6b5..25bc4e94fb 100644
--- a/test/reline/test_key_actor_vi.rb
+++ b/test/reline/test_key_actor_vi.rb
@@ -9,8 +9,8 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
set editing-mode vi
LINES
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
- @line_editor = Reline::LineEditor.new(@config)
- @line_editor.reset(@prompt, @encoding)
+ @line_editor = Reline::LineEditor.new(@config, @encoding)
+ @line_editor.reset(@prompt, encoding: @encoding)
end
def test_vi_command_mode
diff --git a/test/reline/test_macro.rb b/test/reline/test_macro.rb
index c69b50416a..b97de88a97 100644
--- a/test/reline/test_macro.rb
+++ b/test/reline/test_macro.rb
@@ -3,7 +3,8 @@ require_relative 'helper'
class Reline::MacroTest < Reline::TestCase
def setup
@config = Reline::Config.new
- @line_editor = Reline::LineEditor.new(@config)
+ @encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
+ @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")
end
diff --git a/test/reline/test_string_processing.rb b/test/reline/test_string_processing.rb
index 4df0363848..e76fa384f2 100644
--- a/test/reline/test_string_processing.rb
+++ b/test/reline/test_string_processing.rb
@@ -7,8 +7,8 @@ class Reline::LineEditor::StringProcessingTest < Reline::TestCase
@config = Reline::Config.new
Reline::HISTORY.instance_variable_set(:@config, @config)
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
- @line_editor = Reline::LineEditor.new(@config)
- @line_editor.reset(@prompt, @encoding)
+ @line_editor = Reline::LineEditor.new(@config, @encoding)
+ @line_editor.reset(@prompt, encoding: @encoding)
end
def test_calculate_width