From ba360678021d5a3de164de79438f9e07e5c2947a Mon Sep 17 00:00:00 2001 From: Phillip Hellewell Date: Tue, 10 Jan 2023 10:06:48 -0700 Subject: [PATCH 1/2] Change IOGate back to GeneralIO Staying with ANSI can cause side effects with other tests. --- test/reline/test_ansi_with_terminfo.rb | 1 + test/reline/test_ansi_without_terminfo.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/test/reline/test_ansi_with_terminfo.rb b/test/reline/test_ansi_with_terminfo.rb index a6c3a5e500..683fe4a97d 100644 --- a/test/reline/test_ansi_with_terminfo.rb +++ b/test/reline/test_ansi_with_terminfo.rb @@ -9,6 +9,7 @@ def setup end def teardown + Reline.send(:test_mode, ansi: false) # Change IOGate back to GeneralIO Reline.test_reset end diff --git a/test/reline/test_ansi_without_terminfo.rb b/test/reline/test_ansi_without_terminfo.rb index 28b929849b..a45a2a794f 100644 --- a/test/reline/test_ansi_without_terminfo.rb +++ b/test/reline/test_ansi_without_terminfo.rb @@ -9,6 +9,7 @@ def setup end def teardown + Reline.send(:test_mode, ansi: false) # Change IOGate back to GeneralIO Reline.test_reset end From 331c1094ef966b56ab7eb455d915e17528a217be Mon Sep 17 00:00:00 2001 From: Phillip Hellewell Date: Tue, 10 Jan 2023 13:26:32 -0700 Subject: [PATCH 2/2] Reset IOGate in test_reset --- test/reline/helper.rb | 2 ++ test/reline/test_ansi_with_terminfo.rb | 1 - test/reline/test_ansi_without_terminfo.rb | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/reline/helper.rb b/test/reline/helper.rb index be155124a4..e3ce318c44 100644 --- a/test/reline/helper.rb +++ b/test/reline/helper.rb @@ -21,6 +21,8 @@ def test_mode(ansi: false) end def test_reset + remove_const('IOGate') if const_defined?('IOGate') + const_set('IOGate', Reline::GeneralIO) Reline.instance_variable_set(:@core, nil) end end diff --git a/test/reline/test_ansi_with_terminfo.rb b/test/reline/test_ansi_with_terminfo.rb index 683fe4a97d..a6c3a5e500 100644 --- a/test/reline/test_ansi_with_terminfo.rb +++ b/test/reline/test_ansi_with_terminfo.rb @@ -9,7 +9,6 @@ def setup end def teardown - Reline.send(:test_mode, ansi: false) # Change IOGate back to GeneralIO Reline.test_reset end diff --git a/test/reline/test_ansi_without_terminfo.rb b/test/reline/test_ansi_without_terminfo.rb index a45a2a794f..28b929849b 100644 --- a/test/reline/test_ansi_without_terminfo.rb +++ b/test/reline/test_ansi_without_terminfo.rb @@ -9,7 +9,6 @@ def setup end def teardown - Reline.send(:test_mode, ansi: false) # Change IOGate back to GeneralIO Reline.test_reset end