test/readline/test_readline.rb: Use TERM=vt100 to run the tests
Readline seems to emit an escape sequence `"\e[?1034h` at an unpredictable timing when `TERM=xterm` or something. This leads to a noisy random test failure. http://rubyci.s3.amazonaws.com/amazon2/ruby-master/log/20211102T063005Z.fail.html.gz ``` 1) Failure: TestReadline#test_modify_text_in_pre_input_hook [/home/chkbuild/chkbuild/tmp/build/20211102T063005Z/ruby/test/readline/test_readline.rb:404]: <"> hello world\n"> expected but was <"\e[?1034h> hello world\n">. ``` This test is for Ruby's readline extension, not for readline library itself. So here this change force to use "TERM=vt100" to run the tests.
This commit is contained in:
parent
38785aa3b9
commit
905b6aaa7c
@ -7,6 +7,7 @@ require "open3"
|
|||||||
|
|
||||||
module BasetestReadline
|
module BasetestReadline
|
||||||
INPUTRC = "INPUTRC"
|
INPUTRC = "INPUTRC"
|
||||||
|
TERM = "TERM"
|
||||||
SAVED_ENV = %w[COLUMNS LINES]
|
SAVED_ENV = %w[COLUMNS LINES]
|
||||||
|
|
||||||
TIMEOUT = 8
|
TIMEOUT = 8
|
||||||
@ -14,10 +15,12 @@ module BasetestReadline
|
|||||||
def setup
|
def setup
|
||||||
@saved_env = ENV.values_at(*SAVED_ENV)
|
@saved_env = ENV.values_at(*SAVED_ENV)
|
||||||
@inputrc, ENV[INPUTRC] = ENV[INPUTRC], IO::NULL
|
@inputrc, ENV[INPUTRC] = ENV[INPUTRC], IO::NULL
|
||||||
|
@term, ENV[TERM] = ENV[TERM], "vt100"
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
ENV[INPUTRC] = @inputrc
|
ENV[INPUTRC] = @inputrc
|
||||||
|
ENV[TERM] = @term
|
||||||
Readline.instance_variable_set("@completion_proc", nil)
|
Readline.instance_variable_set("@completion_proc", nil)
|
||||||
begin
|
begin
|
||||||
Readline.delete_text
|
Readline.delete_text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user