Skip to content
Myr

test(zsh): verify chpwd fires once in alt-c widget

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by LangLangBart · committed by Junegunn Choi · parent b661538 · Browse files · 1 file+12 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−0 removed

  • tests:+12 added−0 removed

1 file+12 added−0 removed

modified:test/test_shell_integration.rb+12 added
963 unmodified lines
964 tmux.send_keys 'C-c'965 end966 end967968 # Duplicate 'chpwd' calls overcount visits => skews rank tracking tools (e.g. 'zoxide')969 def test_alt_c_chpwd_hook_once970 tmux.send_keys "chpwd() { echo 'chpwd hook fired' >&2 }", :Enter971 tmux.prepare972 tmux.send_keys :Escape, :c973 tmux.until { |lines| assert_operator lines.match_count, :>, 0 }974 tmux.send_keys :Enter975 tmux.until do |lines|976 assert_equal 1, lines.count { |l| l.include?('chpwd hook fired') }977 end978 end979980 # Helper function to run test with Perl and again with Awk981 def self.test_perl_and_awk(name, &block)982 define_method(:"test_#{name}") do983 instance_eval(&block)
309 unmodified lines