summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-01-05 23:02:52 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-01-05 23:02:52 +0900
commita5beb08ed72215e8b015851ad70bf3beca526429 (patch)
tree8b469e7210224defe03290878f5473f2cb8e3ce1 /test
parent45fc7b903d1aab0871f03cbe1c4fbec71b932d9f (diff)
downloadfzf-a5beb08ed72215e8b015851ad70bf3beca526429.tar.gz
Border around the header section
Close #4159
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_go.rb207
1 files changed, 193 insertions, 14 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index 4aff448a..e46e1600 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -3485,6 +3485,24 @@ class TestGoFZF < TestBase
tmux.until { assert_block(block, _1) }
end
+ def test_input_border_and_label_header_first
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --input-border bold --input-label input --input-label-pos 2 --header-lines 3 --query 1 --padding 1,2 --header-first), :Enter
+ block = <<~BLOCK
+ │ 11
+ │ > 10
+ │ ┏input━━━━━
+ │ ┃ 19/97
+ │ ┃ > 1
+ │ ┗━━━━━━━━━━
+ │ 3
+ │ 2
+ │ 1
+ │
+ ╰──────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
def test_list_input_border_and_label
tmux.send_keys %(
seq 100 | #{FZF} --border rounded --list-border double --input-border bold --list-label-pos 2:bottom --input-label-pos 2 --header-lines 3 --query 1 --padding 1,2 \
@@ -3494,32 +3512,193 @@ class TestGoFZF < TestBase
block = <<~BLOCK
│ ║ 11
│ ║ > 10
- │ ║ 3
- │ ║ 2
- │ ║ 1
- │ ╚LIST═════
- │ ┏INPUT━━━━
+ │ ╚LIST══════
+ │ 3
+ │ 2
+ │ 1
+ │ ┏INPUT━━━━━
│ ┃ 19/97
│ ┃ > 1
- │ ┗━━━━━━━━━
+ │ ┗━━━━━━━━━━
- ╰─────────────
+ ╰──────────────
BLOCK
tmux.until { assert_block(block, _1) }
tmux.send_keys :Space
block = <<~BLOCK
│ ║ 11
│ ║ > 10
- │ ║ 3
- │ ║ 2
- │ ║ 1
- │ ╚ list ═══
- │ ┏ input ━━
+ │ ╚ list ════
+ │ 3
+ │ 2
+ │ 1
+ │ ┏ input ━━━
│ ┃ 19/97
│ ┃ > 1
- │ ┗━━━━━━━━━
+ │ ┗━━━━━━━━━━
- ╰─────────────
+ ╰──────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_list_input_border_and_label_header_first
+ tmux.send_keys %(
+ seq 100 | #{FZF} --border rounded --list-border double --input-border bold --list-label-pos 2:bottom --input-label-pos 2 --header-lines 3 --query 1 --padding 1,2 \
+ --bind 'start:transform-input-label(echo INPUT)+transform-list-label(echo LIST)' \
+ --bind 'space:change-input-label( input )+change-list-label( list )' --header-first
+ ).strip, :Enter
+ block = <<~BLOCK
+ │ ║ 11
+ │ ║ > 10
+ │ ╚LIST══════
+ │ ┏INPUT━━━━━
+ │ ┃ 19/97
+ │ ┃ > 1
+ │ ┗━━━━━━━━━━
+ │ 3
+ │ 2
+ │ 1
+ │
+ ╰──────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ tmux.send_keys :Space
+ block = <<~BLOCK
+ │ ║ 11
+ │ ║ > 10
+ │ ╚ list ════
+ │ ┏ input ━━━
+ │ ┃ 19/97
+ │ ┃ > 1
+ │ ┗━━━━━━━━━━
+ │ 3
+ │ 2
+ │ 1
+ │
+ ╰──────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_header_border_and_label
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2), :Enter
+ block = <<~BLOCK
+ │ 12
+ │ 11
+ │ > 10
+ │ ┌────────
+ │ │ 3
+ │ │ 2
+ │ │ 1
+ │ └header──
+ │ 19/97 ─
+ │ > 1
+ │
+ ╰────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_header_border_and_label_header_first
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2 --header-first), :Enter
+ block = <<~BLOCK
+ │ 12
+ │ 11
+ │ > 10
+ │ 19/97 ─
+ │ > 1
+ │ ┌────────
+ │ │ 3
+ │ │ 2
+ │ │ 1
+ │ └header──
+ │
+ ╰────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_header_border_and_label_with_list_border
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --list-border double --list-label list --list-label-pos 2:bottom --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2), :Enter
+ block = <<~BLOCK
+ │ ║ 12
+ │ ║ 11
+ │ ║ > 10
+ │ ╚list════
+ │ ┌────────
+ │ │ 3
+ │ │ 2
+ │ │ 1
+ │ └header──
+ │ 19/97 ─
+ │ > 1
+ │
+ ╰────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_header_border_and_label_with_list_border_header_first
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --list-border double --list-label list --list-label-pos 2:bottom --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2 --header-first), :Enter
+ block = <<~BLOCK
+ │ ║ 12
+ │ ║ 11
+ │ ║ > 10
+ │ ╚list════
+ │ 19/97 ─
+ │ > 1
+ │ ┌────────
+ │ │ 3
+ │ │ 2
+ │ │ 1
+ │ └header──
+ │
+ ╰────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_all_borders
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --list-border double --list-label list --list-label-pos 2:bottom --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2 --input-border bold --input-label input --input-label-pos 2:bottom), :Enter
+ block = <<~BLOCK
+ │ ║ 12
+ │ ║ 11
+ │ ║ > 10
+ │ ╚list══════
+ │ ┌──────────
+ │ │ 3
+ │ │ 2
+ │ │ 1
+ │ └header────
+ │ ┏━━━━━━━━━━
+ │ ┃ 19/97
+ │ ┃ > 1
+ │ ┗input━━━━━
+ │
+ ╰──────────────
+ BLOCK
+ tmux.until { assert_block(block, _1) }
+ end
+
+ def test_all_borders_header_first
+ tmux.send_keys %(seq 100 | #{FZF} --border rounded --list-border double --list-label list --list-label-pos 2:bottom --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2 --input-border bold --input-label input --input-label-pos 2:bottom --header-first), :Enter
+ block = <<~BLOCK
+ │ ║ 12
+ │ ║ 11
+ │ ║ > 10
+ │ ╚list══════
+ │ ┏━━━━━━━━━━
+ │ ┃ 19/97
+ │ ┃ > 1
+ │ ┗input━━━━━
+ │ ┌──────────
+ │ │ 3
+ │ │ 2
+ │ │ 1
+ │ └header────
+ │
+ ╰──────────────
BLOCK
tmux.until { assert_block(block, _1) }
end