summaryrefslogtreecommitdiff
path: root/test/test_go.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_go.rb')
-rwxr-xr-xtest/test_go.rb198
1 files changed, 186 insertions, 12 deletions
diff --git a/test/test_go.rb b/test/test_go.rb
index e782b979..2b9499e0 100755
--- a/test/test_go.rb
+++ b/test/test_go.rb
@@ -3600,6 +3600,180 @@ class TestGoFZF < TestBase
tmux.until { assert_block(block, _1) }
end
+ def test_header_border_toggle
+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()'), :Enter
+ block1 = <<~BLOCK
+ │ 5
+ │ 4
+ │ 3
+ │ 2
+ │ > 1
+ │ 100/100 ─
+ │ >
+ ╰────────────
+ BLOCK
+ tmux.until { assert_block(block1, _1) }
+
+ tmux.send_keys :Space
+ block2 = <<~BLOCK
+ │ 3
+ │ 2
+ │ > 1
+ ╰────────────
+ ╭────────────
+ │ hello
+ ╰────────────
+ 100/100 ─
+ >
+ BLOCK
+ tmux.until { assert_block(block2, _1) }
+
+ tmux.send_keys :Enter
+ tmux.until { assert_block(block1, _1) }
+ end
+
+ def test_header_border_toggle_with_header_lines
+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2), :Enter
+ block1 = <<~BLOCK
+ │ 5
+ │ 4
+ │ > 3
+ ╰──────────
+ ╭──────────
+ │ 2
+ │ 1
+ ╰──────────
+ 98/98 ─
+ >
+ BLOCK
+ tmux.until { assert_block(block1, _1) }
+
+ tmux.send_keys :Space
+ block2 = <<~BLOCK
+ │ 4
+ │ > 3
+ ╰──────────
+ ╭──────────
+ │ 2
+ │ 1
+ │ hello
+ ╰──────────
+ 98/98 ─
+ >
+ BLOCK
+ tmux.until { assert_block(block2, _1) }
+
+ tmux.send_keys :Enter
+ tmux.until { assert_block(block1, _1) }
+ end
+
+ def test_header_border_toggle_with_header_lines_header_first
+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2 --header-first), :Enter
+ block1 = <<~BLOCK
+ │ 5
+ │ 4
+ │ > 3
+ ╰──────────
+ 98/98 ─
+ >
+ ╭──────────
+ │ 2
+ │ 1
+ ╰──────────
+ BLOCK
+ tmux.until { assert_block(block1, _1) }
+
+ tmux.send_keys :Space
+ block2 = <<~BLOCK
+ │ 4
+ │ > 3
+ ╰──────────
+ 98/98 ─
+ >
+ ╭──────────
+ │ 2
+ │ 1
+ │ hello
+ ╰──────────
+ BLOCK
+ tmux.until { assert_block(block2, _1) }
+
+ tmux.send_keys :Enter
+ tmux.until { assert_block(block1, _1) }
+ end
+
+ def test_header_border_toggle_with_header_lines_header_lines_border
+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2 --header-lines-border double), :Enter
+ block1 = <<~BLOCK
+ │ 5
+ │ 4
+ │ > 3
+ ╰──────────
+ ╔══════════
+ ║ 2
+ ║ 1
+ ╚══════════
+ 98/98 ─
+ >
+ BLOCK
+ tmux.until { assert_block(block1, _1) }
+
+ tmux.send_keys :Space
+ block2 = <<~BLOCK
+ │ > 3
+ ╰──────────
+ ╔══════════
+ ║ 2
+ ║ 1
+ ╚══════════
+ ╭──────────
+ │ hello
+ ╰──────────
+ 98/98 ─
+ >
+ BLOCK
+ tmux.until { assert_block(block2, _1) }
+
+ tmux.send_keys :Enter
+ tmux.until { assert_block(block1, _1) }
+ end
+
+ def test_header_border_toggle_with_header_lines_header_first_header_lines_border
+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2 --header-first --header-lines-border double), :Enter
+ block1 = <<~BLOCK
+ │ 5
+ │ 4
+ │ > 3
+ ╰──────────
+ ╔══════════
+ ║ 2
+ ║ 1
+ ╚══════════
+ 98/98 ─
+ >
+ BLOCK
+ tmux.until { assert_block(block1, _1) }
+
+ tmux.send_keys :Space
+ block2 = <<~BLOCK
+ │ > 3
+ ╰──────────
+ ╔══════════
+ ║ 2
+ ║ 1
+ ╚══════════
+ 98/98 ─
+ >
+ ╭──────────
+ │ hello
+ ╰──────────
+ BLOCK
+ tmux.until { assert_block(block2, _1) }
+
+ tmux.send_keys :Enter
+ tmux.until { assert_block(block1, _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
@@ -3625,16 +3799,16 @@ class TestGoFZF < TestBase
│ ║ 12
│ ║ 11
│ ║ > 10
- │ ╚list════
- │ ┌────────
+ │ ╚list══════
+ │ ┌──────────
│ │ 3
│ │ 2
│ │ 1
- │ └header──
- │ 19/97 ─
- │ > 1
+ │ └header────
+ │ 19/97 ─
+ │ > 1
- ╰────────────
+ ╰──────────────
BLOCK
tmux.until { assert_block(block, _1) }
end
@@ -3645,16 +3819,16 @@ class TestGoFZF < TestBase
│ ║ 12
│ ║ 11
│ ║ > 10
- │ ╚list════
- │ 19/97 ─
- │ > 1
- │ ┌────────
+ │ ╚list══════
+ │ 19/97 ─
+ │ > 1
+ │ ┌──────────
│ │ 3
│ │ 2
│ │ 1
- │ └header──
+ │ └header────
- ╰────────────
+ ╰──────────────
BLOCK
tmux.until { assert_block(block, _1) }
end