summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-07-06 22:02:12 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-07-06 22:02:12 +0900
commit82c9671f79c4673b0253db54533e6910f96a92a1 (patch)
treefac736ee0d72a8007db35662ddbaf6be3b6e259a /test
parentd364a1122e23149a6fb2e060fe5f7a0dbb752b20 (diff)
downloadfzf-82c9671f79c4673b0253db54533e6910f96a92a1.tar.gz
Fix selection lost on revision bump
Diffstat (limited to 'test')
-rw-r--r--test/test_core.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_core.rb b/test/test_core.rb
index cf4cd237..4d21c19c 100644
--- a/test/test_core.rb
+++ b/test/test_core.rb
@@ -2002,4 +2002,37 @@ class TestCore < TestInteractive
tmux.until { assert_equal 0, it.select_count }
tmux.until { refute it.any_include?('Selected') }
end
+
+ def test_preserve_selection_on_revision_bump
+ tmux.send_keys %(seq 100 | #{FZF} --multi --sync --query "'1" --bind 'a:select-all+change-header(pressed a),b:change-header(pressed b)+change-nth(1),c:exclude'), :Enter
+ tmux.until do
+ assert_equal 20, it.match_count
+ assert_equal 0, it.select_count
+ end
+ tmux.send_keys :a
+ tmux.until do
+ assert_equal 20, it.match_count
+ assert_equal 20, it.select_count
+ assert it.any_include?('pressed a')
+ end
+ tmux.send_keys :b
+ tmux.until do
+ assert_equal 20, it.match_count
+ assert_equal 20, it.select_count
+ refute it.any_include?('pressed a')
+ assert it.any_include?('pressed b')
+ end
+ tmux.send_keys :a
+ tmux.until do
+ assert_equal 20, it.match_count
+ assert_equal 20, it.select_count
+ assert it.any_include?('pressed a')
+ refute it.any_include?('pressed b')
+ end
+ tmux.send_keys :c
+ tmux.until do
+ assert_equal 19, it.match_count
+ assert_equal 19, it.select_count
+ end
+ end
end