mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert 3b7862c8e8
causing various CI hangs
and dependent commitsc67934b1c3
andf0d1dc5cee
. RubyCI and ci.rvm.jp are almost dead by timeout since this commit. --- Revert "Skip a reline test hanging on Wercker since 3b7862c8e8" This reverts commitf0d1dc5cee
. Revert "Remove extra items because Reline::HISTORY is a sized queue" This reverts commitc67934b1c3
. Revert "Use existing instances for LineEditor and Config" This reverts commit3b7862c8e8
.
This commit is contained in:
parent
797d7efde1
commit
98ba116d40
4 changed files with 5 additions and 51 deletions
|
@ -45,28 +45,11 @@ module Reline
|
||||||
super(index, String.new(val, encoding: Encoding::default_external))
|
super(index, String.new(val, encoding: Encoding::default_external))
|
||||||
end
|
end
|
||||||
|
|
||||||
def concat(*val)
|
|
||||||
val.each do |v|
|
|
||||||
push(*v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def push(*val)
|
def push(*val)
|
||||||
diff = size + val.size - @@config.history_size
|
|
||||||
if diff > 0
|
|
||||||
if diff <= size
|
|
||||||
shift(diff)
|
|
||||||
else
|
|
||||||
diff -= size
|
|
||||||
clear
|
|
||||||
val.shift(diff)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
super(*(val.map{ |v| String.new(v, encoding: Encoding::default_external) }))
|
super(*(val.map{ |v| String.new(v, encoding: Encoding::default_external) }))
|
||||||
end
|
end
|
||||||
|
|
||||||
def <<(val)
|
def <<(val)
|
||||||
shift if size + 1 > @@config.history_size
|
|
||||||
super(String.new(val, encoding: Encoding::default_external))
|
super(String.new(val, encoding: Encoding::default_external))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -423,7 +423,6 @@ module BasetestReadline
|
||||||
|
|
||||||
def test_input_metachar
|
def test_input_metachar
|
||||||
skip "Skip Editline" if /EditLine/n.match(Readline::VERSION)
|
skip "Skip Editline" if /EditLine/n.match(Readline::VERSION)
|
||||||
skip "This hangs on Wercker environment since 3b7862c8e8" if RubyVM::MJIT.enabled?
|
|
||||||
skip("Won't pass on mingw w/readline 7.0.005 [ruby-core:45682]") if mingw?
|
skip("Won't pass on mingw w/readline 7.0.005 [ruby-core:45682]") if mingw?
|
||||||
bug6601 = '[ruby-core:45682]'
|
bug6601 = '[ruby-core:45682]'
|
||||||
Readline::HISTORY << "hello"
|
Readline::HISTORY << "hello"
|
||||||
|
|
|
@ -4,9 +4,9 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
|
||||||
def setup
|
def setup
|
||||||
Reline.send(:test_mode)
|
Reline.send(:test_mode)
|
||||||
@prompt = '> '
|
@prompt = '> '
|
||||||
@config = Reline.class_variable_get(:@@config) # Emacs mode is default
|
@config = Reline::Config.new # Emacs mode is default
|
||||||
@line_editor = Reline.class_variable_get(:@@line_editor)
|
|
||||||
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
|
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
|
||||||
|
@line_editor = Reline::LineEditor.new(@config)
|
||||||
@line_editor.reset(@prompt, @encoding)
|
@line_editor.reset(@prompt, @encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1181,33 +1181,6 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
|
||||||
assert_cursor_max(3)
|
assert_cursor_max(3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_larger_histories_than_history_size
|
|
||||||
history_size = @config.history_size
|
|
||||||
@config.history_size = 2
|
|
||||||
Reline::HISTORY.concat(%w{abc 123 AAA})
|
|
||||||
assert_line('')
|
|
||||||
assert_byte_pointer_size('')
|
|
||||||
assert_cursor(0)
|
|
||||||
assert_cursor_max(0)
|
|
||||||
input_keys("\C-p")
|
|
||||||
assert_line('AAA')
|
|
||||||
assert_byte_pointer_size('AAA')
|
|
||||||
assert_cursor(3)
|
|
||||||
assert_cursor_max(3)
|
|
||||||
input_keys("\C-p")
|
|
||||||
assert_line('123')
|
|
||||||
assert_byte_pointer_size('123')
|
|
||||||
assert_cursor(3)
|
|
||||||
assert_cursor_max(3)
|
|
||||||
input_keys("\C-p")
|
|
||||||
assert_line('123')
|
|
||||||
assert_byte_pointer_size('123')
|
|
||||||
assert_cursor(3)
|
|
||||||
assert_cursor_max(3)
|
|
||||||
ensure
|
|
||||||
@config.history_size = history_size
|
|
||||||
end
|
|
||||||
|
|
||||||
=begin # TODO: move KeyStroke instance from Reline to LineEditor
|
=begin # TODO: move KeyStroke instance from Reline to LineEditor
|
||||||
def test_key_delete
|
def test_key_delete
|
||||||
input_keys('ab')
|
input_keys('ab')
|
||||||
|
|
|
@ -4,13 +4,12 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
|
||||||
def setup
|
def setup
|
||||||
Reline.send(:test_mode)
|
Reline.send(:test_mode)
|
||||||
@prompt = '> '
|
@prompt = '> '
|
||||||
@config = Reline.class_variable_get(:@@config) # Emacs mode is default
|
@config = Reline::Config.new
|
||||||
@config.read_lines(<<~LINES.split(/(?<=\n)/))
|
@config.read_lines(<<~LINES.split(/(?<=\n)/))
|
||||||
set editing-mode vi
|
set editing-mode vi
|
||||||
LINES
|
LINES
|
||||||
@line_editor = Reline.class_variable_get(:@@line_editor)
|
@line_editor = Reline::LineEditor.new(@config)
|
||||||
@encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
|
@line_editor.reset(@prompt, (RELINE_TEST_ENCODING rescue Encoding.default_external))
|
||||||
@line_editor.reset(@prompt, @encoding)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_vi_command_mode
|
def test_vi_command_mode
|
||||||
|
|
Loading…
Reference in a new issue