ruby-changes:60158
From: MSP-Greg <ko1@a...>
Date: Sat, 22 Feb 2020 10:01:26 +0900 (JST)
Subject: [ruby-changes:60158] da31035687 (master): test/readline - allow ENV control of test class creation
https://git.ruby-lang.org/ruby.git/commit/?id=da31035687 From da310356874ae30f793911223562ece2449a05e7 Mon Sep 17 00:00:00 2001 From: MSP-Greg <MSP-Greg@u...> Date: Wed, 19 Feb 2020 08:11:32 -0600 Subject: test/readline - allow ENV control of test class creation In ruby/ruby, the tests run on both readline & reline by creating four test classes: ``` TestReadline TestReadlineHistory TestRelineAsReadline TestRelineAsReadlineHistory ``` Reline inports the test files and uses them in its CI. Adding the ENV control allows it to only run the `TestRelineAsReadline` classes. diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 5e1f138..0d0eb04 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -784,7 +784,7 @@ class TestReadline < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L784 use_ext_readline super end -end if defined?(ReadlineSo) +end if defined?(ReadlineSo) && ENV["TEST_READLINE_OR_RELINE"] != "Reline" class TestRelineAsReadline < Test::Unit::TestCase include BasetestReadline @@ -801,4 +801,4 @@ class TestRelineAsReadline < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline.rb#L801 super end end -end if defined?(Reline) +end if defined?(Reline) && ENV["TEST_READLINE_OR_RELINE"] != "Readline" diff --git a/test/readline/test_readline_history.rb b/test/readline/test_readline_history.rb index 98fef65..f4e93fa 100644 --- a/test/readline/test_readline_history.rb +++ b/test/readline/test_readline_history.rb @@ -260,6 +260,7 @@ class TestReadlineHistory < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline_history.rb#L260 super end end if defined?(::ReadlineSo) && defined?(::ReadlineSo::HISTORY) && + ENV["TEST_READLINE_OR_RELINE"] != "Reline" && ( begin ReadlineSo::HISTORY.clear @@ -283,4 +284,4 @@ class TestRelineAsReadlineHistory < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/readline/test_readline_history.rb#L284 super end end -end if defined?(Reline) +end if defined?(Reline) && ENV["TEST_READLINE_OR_RELINE"] != "Readline" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/