mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-13 12:33:44 +02:00
test(zsh): verify chpwd fires once in alt-c widget
This commit is contained in:
parent
b66153825f
commit
ca51a57aed
1 changed files with 12 additions and 0 deletions
|
|
@ -965,6 +965,18 @@ class TestZsh < TestBase
|
|||
end
|
||||
end
|
||||
|
||||
# Duplicate 'chpwd' calls overcount visits => skews rank tracking tools (e.g. 'zoxide')
|
||||
def test_alt_c_chpwd_hook_once
|
||||
tmux.send_keys "chpwd() { echo 'chpwd hook fired' >&2 }", :Enter
|
||||
tmux.prepare
|
||||
tmux.send_keys :Escape, :c
|
||||
tmux.until { |lines| assert_operator lines.match_count, :>, 0 }
|
||||
tmux.send_keys :Enter
|
||||
tmux.until do |lines|
|
||||
assert_equal 1, lines.count { |l| l.include?('chpwd hook fired') }
|
||||
end
|
||||
end
|
||||
|
||||
# Helper function to run test with Perl and again with Awk
|
||||
def self.test_perl_and_awk(name, &block)
|
||||
define_method(:"test_#{name}") do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue