summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-09-28 20:59:20 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-10-09 00:17:00 +0900
commit65df0abf0e4143470d824145ecc313e40dd8773d (patch)
tree8b5df786eb5aed184ddc4aeb9718c684495c8420 /test
parentb51bc6b50e90169553c48209c00c5f4d548ec0a0 (diff)
downloadfzf-65df0abf0e4143470d824145ecc313e40dd8773d.tar.gz
Introduce 'raw' mode
Diffstat (limited to 'test')
-rw-r--r--test/test_raw.rb60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/test_raw.rb b/test/test_raw.rb
new file mode 100644
index 00000000..4e3c36ea
--- /dev/null
+++ b/test/test_raw.rb
@@ -0,0 +1,60 @@
+# frozen_string_literal: true
+
+require_relative 'lib/common'
+
+# Testing raw mode
+class TestRaw < TestInteractive
+ def test_raw_mode
+ tmux.send_keys %(seq 1000 | #{FZF} --raw --bind ctrl-x:toggle-raw --gutter '▌' --multi), :Enter
+ tmux.until { assert_equal 1000, it.match_count }
+
+ tmux.send_keys 1
+ tmux.until { assert_equal 272, it.match_count }
+
+ tmux.send_keys :Up
+ tmux.until { assert_includes it, '> 2' }
+
+ tmux.send_keys 'C-p'
+ tmux.until do
+ assert_includes it, '> 10'
+ assert_includes it, '▖ 9'
+ end
+
+ tmux.send_keys 'C-x'
+ tmux.until do
+ assert_includes it, '> 10'
+ assert_includes it, '▌ 1'
+ end
+
+ tmux.send_keys :Up, 'C-x'
+ tmux.until do
+ assert_includes it, '> 11'
+ assert_includes it, '▖ 10'
+ end
+
+ tmux.send_keys 1
+ tmux.until { assert_equal 28, it.match_count }
+
+ tmux.send_keys 'C-p'
+ tmux.until do
+ assert_includes it, '> 101'
+ assert_includes it, '▖ 100'
+ end
+
+ tmux.send_keys 'C-n'
+ tmux.until do
+ assert_includes it, '> 11'
+ assert_includes it, '▖ 10'
+ end
+
+ tmux.send_keys :Tab, :Tab, :Tab
+ tmux.until { assert_equal 3, it.select_count }
+
+ tmux.send_keys 'C-x'
+ tmux.until do
+ assert_equal 1, it.select_count
+ assert_includes it, '▌ 110'
+ assert_includes it, '>>11'
+ end
+ end
+end