diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-09-16 21:22:56 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-16 21:22:56 +0900 |
| commit | a67aa85820c2e278e1c32fb8fdfe137523537ccb (patch) | |
| tree | 05f9f818606d18fd34c56037f0033a4540d41082 /test | |
| parent | c5cabe1691a0c486ae0ac733106aa1b843db2f59 (diff) | |
| download | fzf-a67aa85820c2e278e1c32fb8fdfe137523537ccb.tar.gz | |
Style change: thinner gutter column (#4521)
Diffstat (limited to 'test')
| -rw-r--r-- | test/lib/common.rb | 2 | ||||
| -rw-r--r-- | test/test_exec.rb | 2 | ||||
| -rw-r--r-- | test/test_layout.rb | 68 |
3 files changed, 54 insertions, 18 deletions
diff --git a/test/lib/common.rb b/test/lib/common.rb index ec8b05e9..d93c7685 100644 --- a/test/lib/common.rb +++ b/test/lib/common.rb @@ -24,7 +24,7 @@ DEFAULT_TIMEOUT = 10 FILE = File.expand_path(__FILE__) BASE = File.expand_path('../..', __dir__) Dir.chdir(BASE) -FZF = "FZF_DEFAULT_OPTS=\"--no-scrollbar --pointer \\> --marker \\>\" FZF_DEFAULT_COMMAND= #{BASE}/bin/fzf".freeze +FZF = %[FZF_DEFAULT_OPTS="--no-scrollbar --gutter ' ' --pointer '>' --marker '>'" FZF_DEFAULT_COMMAND= #{BASE}/bin/fzf].freeze def wait(timeout = DEFAULT_TIMEOUT) since = Time.now diff --git a/test/test_exec.rb b/test/test_exec.rb index c02e8c94..339a2bde 100644 --- a/test/test_exec.rb +++ b/test/test_exec.rb @@ -403,7 +403,7 @@ class TestExec < TestInteractive end def test_become - tmux.send_keys "seq 100 | #{FZF} --bind 'enter:become:seq {} | #{FZF}'", :Enter + tmux.send_keys "seq 100 | fzf --bind 'enter:become:seq {} | fzf'", :Enter tmux.until { |lines| assert_equal 100, lines.match_count } tmux.send_keys 999 tmux.until { |lines| assert_equal 0, lines.match_count } diff --git a/test/test_layout.rb b/test/test_layout.rb index fd92cd63..db04c044 100644 --- a/test/test_layout.rb +++ b/test/test_layout.rb @@ -178,8 +178,8 @@ class TestLayout < TestInteractive tmux.send_keys 'seq 3 | fzf --height ~100% --info=inline --border rounded', :Enter expected = <<~OUTPUT ╭────────── - │ 3 - │ 2 + │ ▌ 3 + │ ▌ 2 │ > 1 │ > < 3/3 ╰────────── @@ -197,8 +197,8 @@ class TestLayout < TestInteractive │ │ │ │ │ ╰──────── - │ 3 - │ 2 + │ ▌ 3 + │ ▌ 2 │ > 1 │ > < 3/3 ╰────────── @@ -247,7 +247,7 @@ class TestLayout < TestInteractive tmux.send_keys 'seq 100 | fzf --height ~5 --info=inline --border rounded', :Enter expected = <<~OUTPUT ╭────────────── - │ 2 + │ ▌ 2 │ > 1 │ > < 100/100 ╰────────────── @@ -275,12 +275,12 @@ class TestLayout < TestInteractive def test_fzf_multi_line tmux.send_keys %[(echo -en '0\\0'; echo -en '1\\n2\\0'; seq 1000) | fzf --read0 --multi --bind load:select-all --border rounded], :Enter block = <<~BLOCK - │ ┃998 - │ ┃999 - │ ┃1000 - │ ╹ - │ ╻1 - │ ╹2 + │ ▌┃998 + │ ▌┃999 + │ ▌┃1000 + │ ▌╹ + │ ▌╻1 + │ ▌╹2 │ >>0 │ 3/3 (3) │ > @@ -312,11 +312,11 @@ class TestLayout < TestInteractive │ > │ 3/3 (3) │ >>0 - │ ╻1 - │ ╹2 - │ ╻1 - │ ┃2 - │ ┃3 + │ ▌╻1 + │ ▌╹2 + │ ▌╻1 + │ ▌┃2 + │ ▌┃3 BLOCK tmux.until { assert_block(block, it) } end @@ -1156,6 +1156,42 @@ class TestLayout < TestInteractive tmux.until { assert_block(block, it) } end + def test_gutter_default + tmux.send_keys %(seq 10 | fzf), :Enter + block = <<~BLOCK + ▌ 3 + ▌ 2 + > 1 + 10/10 + > + BLOCK + tmux.until { assert_block(block, it) } + end + + def test_gutter_default_no_unicode + tmux.send_keys %(seq 10 | fzf --no-unicode), :Enter + block = <<~BLOCK + 3 + 2 + > 1 + 10/10 + > + BLOCK + tmux.until { assert_block(block, it) } + end + + def test_gutter_custom + tmux.send_keys %(seq 10 | fzf --gutter x), :Enter + block = <<~BLOCK + x 3 + x 2 + > 1 + 10/10 + > + BLOCK + tmux.until { assert_block(block, it) } + end + def test_combinations skip unless ENV['LONGTEST'] |
