ruby-changes:68309
From: aycabta <ko1@a...>
Date: Fri, 8 Oct 2021 10:34:33 +0900 (JST)
Subject: [ruby-changes:68309] 1251edd1db (master): [ruby/irb] Add tests for truncated show doc dialog
https://git.ruby-lang.org/ruby.git/commit/?id=1251edd1db From 1251edd1db3fe89b5198422949af4595192113db Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Fri, 8 Oct 2021 10:28:44 +0900 Subject: [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 --- test/irb/yamatanooroti/test_rendering.rb | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/irb/yamatanooroti/test_rendering.rb b/test/irb/yamatanooroti/test_rendering.rb index ac6df30c62..7ed98b11c1 100644 --- a/test/irb/yamatanooroti/test_rendering.rb +++ b/test/irb/yamatanooroti/test_rendering.rb @@ -170,6 +170,52 @@ begin https://github.com/ruby/ruby/blob/trunk/test/irb/yamatanooroti/test_rendering.rb#L170 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/