[ruby/irb] Add tests for truncated show doc dialog

But pending them now because they need dummy document data to show doc.

https://github.com/ruby/irb/commit/ac471ee14e
This commit is contained in:
aycabta 2021-10-08 10:28:44 +09:00 коммит произвёл git
Родитель 1507cb084c
Коммит 1251edd1db
1 изменённых файлов: 46 добавлений и 0 удалений

Просмотреть файл

@ -170,6 +170,52 @@ begin
EOC
end
def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
pend "Needs a dummy document to show doc"
write_irbrc <<~'LINES'
IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ",
:PROMPT_N => "%03n> ",
:PROMPT_S => "%03n> ",
:PROMPT_C => "%03n> "
}
IRB.conf[:PROMPT_MODE] = :MY_PROMPT
puts 'start IRB'
LINES
start_terminal(4, 19, %W{ruby -I/home/aycabta/ruby/reline/lib -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
write("Str\C-i")
close
assert_screen(<<~EOC)
001> String
StringPress A
StructString
of byte
EOC
end
def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left
pend "Needs a dummy document to show doc"
write_irbrc <<~'LINES'
IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ",
:PROMPT_N => "%03n> ",
:PROMPT_S => "%03n> ",
:PROMPT_C => "%03n> "
}
IRB.conf[:PROMPT_MODE] = :MY_PROMPT
puts 'start IRB'
LINES
start_terminal(4, 12, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
write("Str\C-i")
close
assert_screen(<<~EOC)
001> String
PressString
StrinStruct
of by
EOC
end
private def write_irbrc(content)
File.open(@irbrc_file, 'w') do |f|
f.write content