mirror of
https://github.com/tmux/tmux.git
synced 2026-08-03 22:18:36 +00:00
Tests for hooks time and count.
This commit is contained in:
@@ -85,6 +85,11 @@ echo "$shown" | grep -q '^session-created\[0\]' ||
|
||||
fail "missing first array item: $shown"
|
||||
echo "$shown" | grep -q '^session-created\[1\]' ||
|
||||
fail "missing second array item: $shown"
|
||||
shown=$($TMUX show-hooks -gF '#{option_name}:#{hook_fire_count}:#{t/p:hook_fire_time}' \
|
||||
session-created) ||
|
||||
fail "show-hooks -gF failed"
|
||||
echo "$shown" | grep -q '^session-created:[1-9][0-9]*:[^-][^ ]*$' ||
|
||||
fail "missing hook fire formats: $shown"
|
||||
|
||||
# User hooks are options, but show-hooks should list only registered @ hooks
|
||||
# and not ordinary user options.
|
||||
|
||||
@@ -81,6 +81,11 @@ assert_unchanged @seen 0
|
||||
|
||||
$TMUX rename-session two || fail "rename-session two failed"
|
||||
wait_for @seen '@session-name:two'
|
||||
shown=$($TMUX show-hooks -g -BF '#{hook_fire_count}:#{t/p:hook_fire_time}' \
|
||||
@session-name) ||
|
||||
fail "show-hooks -BF fire failed"
|
||||
echo "$shown" | grep -q '^1:[^-][^ ]*$' ||
|
||||
fail "unexpected show-hooks -BF fire output: $shown"
|
||||
|
||||
$TMUX set -g @seen-last 0 || fail "set @seen-last failed"
|
||||
$TMUX set-hook -g -B '@session-name::#{session_name}' \
|
||||
|
||||
Reference in New Issue
Block a user