[前][次][番号順一覧][スレッド一覧]

ruby-changes:68334

From: aycabta <ko1@a...>
Date: Sat, 9 Oct 2021 23:23:18 +0900 (JST)
Subject: [ruby-changes:68334] bf1f6a696f (master): [ruby/reline] Add a test for full-width scrollbar

https://git.ruby-lang.org/ruby.git/commit/?id=bf1f6a696f

From bf1f6a696fbd96379d3d5b85afbe5639ecea2f14 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sat, 9 Oct 2021 23:07:18 +0900
Subject: [ruby/reline] Add a test for full-width scrollbar

https://github.com/ruby/reline/commit/cff83e68f8
---
 test/reline/yamatanooroti/multiline_repl    |  6 ++++++
 test/reline/yamatanooroti/test_rendering.rb | 13 +++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/test/reline/yamatanooroti/multiline_repl b/test/reline/yamatanooroti/multiline_repl
index b80d1b3ab2..2e826793fa 100755
--- a/test/reline/yamatanooroti/multiline_repl
+++ b/test/reline/yamatanooroti/multiline_repl
@@ -74,8 +74,14 @@ opt.on('--dialog VAL') { |v| https://github.com/ruby/ruby/blob/trunk/test/reline/yamatanooroti/multiline_repl#L74
     if v.include?('scrollbar')
       scrollbar = true
     end
+    if v.include?('alt-scrollbar')
+      scrollbar = true
+    end
     Reline::DialogRenderInfo.new(pos: cursor_pos, contents: contents, height: height, scrollbar: scrollbar)
   })
+  if v.include?('alt-scrollbar')
+    ENV['RELINE_ALT_SCROLLBAR'] = '1'
+  end
 }
 opt.on('--complete') {
   Reline.completion_proc = lambda { |target, preposing = nil, postposing = nil|
diff --git a/test/reline/yamatanooroti/test_rendering.rb b/test/reline/yamatanooroti/test_rendering.rb
index 08a6171786..0bfa0df71b 100644
--- a/test/reline/yamatanooroti/test_rendering.rb
+++ b/test/reline/yamatanooroti/test_rendering.rb
@@ -1114,6 +1114,19 @@ begin https://github.com/ruby/ruby/blob/trunk/test/reline/yamatanooroti/test_rendering.rb#L1114
       EOC
     end
 
+    def test_dialog_with_fullwidth_scrollbar
+      start_terminal(20, 40, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl --dialog simple,scrollkey,alt-scrollbar}, startup_message: 'Multiline REPL.')
+      close
+      assert_screen(<<~'EOC')
+        Multiline REPL.
+        prompt>
+           Ruby is...                         ::
+           A dynamic, open source programming ::
+           language with a focus on simplicity''
+           and productivity. It has an elegant
+      EOC
+    end
+
     def test_rerender_argument_prompt_after_pasting
       start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
       write('abcdef')
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]