Skip to content

Commit 60685aa

Browse files
committed
fix test_readline#test_without_tty failure
ruby/ruby#5417
1 parent 360db7c commit 60685aa

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ exclude-several-tests-unstable-in-Docker.patch
66
Fix-FTBFS-on-x32-misdetected-as-i386-or-amd64.patch
77
TestProcess-disable-gems-to-disable-rubygems_integration.patch
88
ruby_default_arch.m4-don-t-require-arhitectures-to-be-kno.patch
9+
test_readline-test_without_tty-Use-EnvUtil.rubybin.patch
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From: Sorah Fukumori <[email protected]>
2+
Date: Sat, 8 Jan 2022 14:03:02 +0900
3+
Subject: test_readline#test_without_tty: Use EnvUtil.rubybin
4+
5+
`ruby` is not always available in certain build environments and
6+
configure options. Choose appropriate command line using EnvUtil.
7+
---
8+
test/readline/test_readline.rb | 4 +++-
9+
1 file changed, 3 insertions(+), 1 deletion(-)
10+
11+
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb
12+
index be338c6..be6e65f 100644
13+
--- a/test/readline/test_readline.rb
14+
+++ b/test/readline/test_readline.rb
15+
@@ -6,6 +6,8 @@ require "timeout"
16+
require "open3"
17+
18+
module BasetestReadline
19+
+ RUBY = EnvUtil.rubybin
20+
+
21+
INPUTRC = "INPUTRC"
22+
TERM = "TERM"
23+
SAVED_ENV = %w[COLUMNS LINES]
24+
@@ -839,7 +841,7 @@ module BasetestReadline
25+
loader = "use_lib_reline"
26+
end
27+
if loader
28+
- res, exit_status = Open3.capture2e("ruby -I#{__dir__} -Ilib -rhelper -e '#{loader}; Readline.readline(%{y or n?})'", stdin_data: "y\n")
29+
+ res, exit_status = Open3.capture2e("#{RUBY} -I#{__dir__} -Ilib -rhelper -e '#{loader}; Readline.readline(%{y or n?})'", stdin_data: "y\n")
30+
assert exit_status.success?, "It should work fine without tty, but it failed.\nError output:\n#{res}"
31+
end
32+
end

0 commit comments

Comments
 (0)