[前][次][番号順一覧][スレッド一覧]

ruby-changes:55893

From: Takashi <ko1@a...>
Date: Wed, 29 May 2019 09:06:28 +0900 (JST)
Subject: [ruby-changes:55893] Takashi Kokubun: 98ba116d40 (trunk): Revert 3b7862c8e88cd7838a53ec083ac5733386400956 causing various CI hangs

https://git.ruby-lang.org/ruby.git/commit/?id=98ba116d40

From 98ba116d402e7c255dae78ce43b76723a56c4cb7 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Wed, 29 May 2019 09:02:39 +0900
Subject: Revert 3b7862c8e88cd7838a53ec083ac5733386400956 causing various CI
 hangs

and dependent commits c67934b1c3b40dda5f170b032423e520511c68dd and
f0d1dc5cee87dfb023cb43a2db9bcdef5a8dee8f.

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 commit f0d1dc5cee87dfb023cb43a2db9bcdef5a8dee8f.

Revert "Remove extra items because Reline::HISTORY is a sized queue"

This reverts commit c67934b1c3b40dda5f170b032423e520511c68dd.

Revert "Use existing instances for LineEditor and Config"

This reverts commit 3b7862c8e88cd7838a53ec083ac5733386400956.

diff --git a/lib/reline.rb b/lib/reline.rb
index 8e7d4ff..656fab2 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -45,28 +45,11 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L45
       super(index, String.new(val, encoding: Encoding::default_external))
     end
 
-    def concat(*val)
-      val.each do |v|
-        push(*v)
-      end
-    end
-
     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) }))
     end
 
     def <<(val)
-      shift if size + 1 > @@config.history_size
       super(String.new(val, encoding: Encoding::default_external))
     end
 
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
index 6ff7b9a2..e040ac5 100644
--- a/test/readline/test_readline.rb
+++ b/test/readline/test_readline.rb
@@ -423,7 +423,6 @@ module BasetestReadline https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L423
 
   def test_input_metachar
     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?
     bug6601 = '[ruby-core:45682]'
     Readline::HISTORY << "hello"
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index e7596ff..5778677 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -4,9 +4,9 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_key_actor_emacs.rb#L4
   def setup
     Reline.send(:test_mode)
     @prompt = '> '
-    @config = Reline.class_variable_get(:@@config) # Emacs mode is default
-    @line_editor = Reline.class_variable_get(:@@line_editor)
+    @config = Reline::Config.new # Emacs mode is default
     @encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
+    @line_editor = Reline::LineEditor.new(@config)
     @line_editor.reset(@prompt, @encoding)
   end
 
@@ -1181,33 +1181,6 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_key_actor_emacs.rb#L1181
     assert_cursor_max(3)
   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
   def test_key_delete
     input_keys('ab')
diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb
index ac62a09..f5ceda0 100644
--- a/test/reline/test_key_actor_vi.rb
+++ b/test/reline/test_key_actor_vi.rb
@@ -4,13 +4,12 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_key_actor_vi.rb#L4
   def setup
     Reline.send(:test_mode)
     @prompt = '> '
-    @config = Reline.class_variable_get(:@@config) # Emacs mode is default
+    @config = Reline::Config.new
     @config.read_lines(<<~LINES.split(/(?<=\n)/))
       set editing-mode vi
     LINES
-    @line_editor = Reline.class_variable_get(:@@line_editor)
-    @encoding = (RELINE_TEST_ENCODING rescue Encoding.default_external)
-    @line_editor.reset(@prompt, @encoding)
+    @line_editor = Reline::LineEditor.new(@config)
+    @line_editor.reset(@prompt, (RELINE_TEST_ENCODING rescue Encoding.default_external))
   end
 
   def test_vi_command_mode
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]