From 75f196ce75f35ecbab8186c9ada2f3a91160f8f9 Mon Sep 17 00:00:00 2001 From: aycabta Date: Mon, 13 May 2019 03:29:18 +0900 Subject: [PATCH] Skip tests depend on Readline's special behaviors --- test/readline/test_readline.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 80208b9c07..0399ab44dc 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -113,7 +113,7 @@ class TestReadline < Test::Unit::TestCase assert_equal(true, Readline.line_buffer.tainted?) assert_equal(21, Readline.point) end - end + end if Readline != Reline end def test_input= @@ -376,12 +376,14 @@ class TestReadline < Test::Unit::TestCase assert_equal(str, Readline.line_buffer) Readline.delete_text - # NOTE: unexpected but GNU Readline's spec - assert_equal(16, Readline.point) - assert_equal("", Readline.line_buffer) - assert_equal(Readline, Readline.insert_text(str)) - assert_equal(32, Readline.point) - assert_equal("", Readline.line_buffer) + unless Readline == Reline + # NOTE: unexpected but GNU Readline's spec + assert_equal(16, Readline.point) + assert_equal("", Readline.line_buffer) + assert_equal(Readline, Readline.insert_text(str)) + assert_equal(32, Readline.point) + assert_equal("", Readline.line_buffer) + end rescue NotImplementedError end if !/EditLine/n.match(Readline::VERSION) @@ -399,7 +401,9 @@ class TestReadline < Test::Unit::TestCase line = Readline.readline("> ") assert_equal("hello world", line) end - assert_equal("> hello world\n", stdout.read) + unless Readline == Reline # Reline's rendering logic is tricky + assert_equal("> hello world\n", stdout.read) + end stdout.close rescue NotImplementedError ensure