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

ruby-changes:62648

From: aycabta <ko1@a...>
Date: Wed, 19 Aug 2020 19:15:44 +0900 (JST)
Subject: [ruby-changes:62648] f81811fc2f (master): Skip Editline for history tests of IRB

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

From f81811fc2f5cedfc8dae0a917e15442244c55322 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 19 Aug 2020 19:13:13 +0900
Subject: Skip Editline for history tests of IRB

Because Editline erases all histories in Readline::HISTORY when
Readline.readline is called.

diff --git a/test/irb/test_history.rb b/test/irb/test_history.rb
index 4417d90..0c7f78c 100644
--- a/test/irb/test_history.rb
+++ b/test/irb/test_history.rb
@@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/test/irb/test_history.rb#L1
 # frozen_string_literal: false
 require 'test/unit'
 require 'irb'
+require 'readline'
 
 module TestIRB
   class TestHistory < Test::Unit::TestCase
@@ -13,9 +14,11 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_history.rb#L14
     end
 
     def test_history_save_1
+      omit "Skip Editline" if /EditLine/n.match(Readline::VERSION)
       _result_output, result_history_file = launch_irb_with_irbrc_and_irb_history(<<~IRBRC, <<~IRB_HISTORY) do |stdin|
         IRB.conf[:USE_READLINE] = true
         IRB.conf[:SAVE_HISTORY] = 1
+        IRB.conf[:USE_READLINE] = true
       IRBRC
         1
         2
@@ -31,9 +34,11 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_history.rb#L34
     end
 
     def test_history_save_100
+      omit "Skip Editline" if /EditLine/n.match(Readline::VERSION)
       _result_output, result_history_file = launch_irb_with_irbrc_and_irb_history(<<~IRBRC, <<~IRB_HISTORY) do |stdin|
         IRB.conf[:USE_READLINE] = true
         IRB.conf[:SAVE_HISTORY] = 100
+        IRB.conf[:USE_READLINE] = true
       IRBRC
         1
         2
@@ -54,9 +59,11 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_history.rb#L59
     end
 
     def test_history_save_bignum
+      omit "Skip Editline" if /EditLine/n.match(Readline::VERSION)
       _result_output, result_history_file = launch_irb_with_irbrc_and_irb_history(<<~IRBRC, <<~IRB_HISTORY) do |stdin|
         IRB.conf[:USE_READLINE] = true
         IRB.conf[:SAVE_HISTORY] = 10 ** 19
+        IRB.conf[:USE_READLINE] = true
       IRBRC
         1
         2
@@ -77,9 +84,11 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_history.rb#L84
     end
 
     def test_history_save_minus_as_infinity
+      omit "Skip Editline" if /EditLine/n.match(Readline::VERSION)
       _result_output, result_history_file = launch_irb_with_irbrc_and_irb_history(<<~IRBRC, <<~IRB_HISTORY) do |stdin|
         IRB.conf[:USE_READLINE] = true
         IRB.conf[:SAVE_HISTORY] = -1 # infinity
+        IRB.conf[:USE_READLINE] = true
       IRBRC
         1
         2
-- 
cgit v0.10.2


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

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