Skip to content

Commit e592ce7

Browse files
committed
Update compatibility matrix for test_option_equals_completion
1 parent e62bbdc commit e592ce7

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

test/test_shell_integration.rb

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -440,32 +440,6 @@ def test_ssh_completion
440440
end
441441
end
442442

443-
def test_option_prefix_completion
444-
skip('this test fails on bash/zsh') if shell != :fish
445-
FileUtils.mkdir_p('/tmp/fzf-test-opt')
446-
FileUtils.touch('/tmp/fzf-test-opt/xyz123')
447-
tmux.prepare
448-
tmux.send_keys "some-command --somearg=/tmp/fzf-test-opt/xyz#{trigger}", :Tab
449-
tmux.until { |lines| assert_equal 1, lines.match_count }
450-
tmux.send_keys :Enter
451-
tmux.until(true) { |lines| assert lines[-1]&.include?('xyz123') }
452-
ensure
453-
FileUtils.rm_rf('/tmp/fzf-test-opt')
454-
end
455-
456-
def test_short_option_prefix_completion
457-
skip('this test fails on bash/zsh') if shell != :fish
458-
FileUtils.mkdir_p('/tmp/fzf-test-short')
459-
FileUtils.touch('/tmp/fzf-test-short/xyz123')
460-
tmux.prepare
461-
tmux.send_keys "some-command -o/tmp/fzf-test-short/xyz#{trigger}", :Tab
462-
tmux.until { |lines| assert_equal 1, lines.match_count }
463-
tmux.send_keys :Enter
464-
tmux.until(true) { |lines| assert lines[-1]&.include?('xyz123') }
465-
ensure
466-
FileUtils.rm_rf('/tmp/fzf-test-short')
467-
end
468-
469443
def test_option_equals_completion
470444
FileUtils.mkdir_p('/tmp/fzf-test-opt-eq')
471445
FileUtils.touch('/tmp/fzf-test-opt-eq/file1.txt')
@@ -499,8 +473,36 @@ def test_option_equals_completion
499473
tmux.until(true) { |lines| assert lines[-1]&.include?('-o=/tmp/fzf-test-opt-eq/file2.txt') }
500474
end
501475

476+
# Test --opt=/**<TAB> (long option with equals and slash prefix)
477+
if shell == :fish
478+
tmux.send_keys 'C-u'
479+
tmux.send_keys "some-command --output=/tmp/fzf-test-opt-eq/file#{trigger}", :Tab
480+
tmux.until do |lines|
481+
assert_equal 2, lines.match_count
482+
assert_includes lines, '> file'
483+
end
484+
tmux.send_keys '1'
485+
tmux.until { |lines| assert_equal 1, lines.match_count }
486+
tmux.send_keys :Enter
487+
tmux.until(true) { |lines| assert lines[-1]&.include?('--output=/tmp/fzf-test-opt-eq/file1.txt') }
488+
end
489+
490+
# Test -o/**<TAB> (short option without equals)
491+
if shell == :fish
492+
tmux.send_keys 'C-u'
493+
tmux.send_keys "some-command -o/tmp/fzf-test-opt-eq/file#{trigger}", :Tab
494+
tmux.until do |lines|
495+
assert_equal 2, lines.match_count
496+
assert_includes lines, '> file'
497+
end
498+
tmux.send_keys '2'
499+
tmux.until { |lines| assert_equal 1, lines.match_count }
500+
tmux.send_keys :Enter
501+
tmux.until(true) { |lines| assert lines[-1]&.include?('-o/tmp/fzf-test-opt-eq/file2.txt') }
502+
end
503+
502504
# Test -- --opt=**<TAB>
503-
if shell != :zsh
505+
if shell == :bash
504506
tmux.send_keys 'C-u'
505507
tmux.send_keys "some-command -- --output=/tmp/fzf-test-opt-eq/file#{trigger}", :Tab
506508
tmux.until do |lines|
@@ -514,7 +516,7 @@ def test_option_equals_completion
514516
end
515517

516518
# Test -- -o=**<TAB>
517-
if shell != :zsh
519+
if shell == :bash
518520
tmux.send_keys 'C-u'
519521
tmux.send_keys "some-command -- -o=/tmp/fzf-test-opt-eq/file#{trigger}", :Tab
520522
tmux.until do |lines|

0 commit comments

Comments
 (0)