Tests from GitHub issue 5576.

This commit is contained in:
Nicholas Marriott
2026-09-07 13:05:38 +01:00
parent 578e07fcbc
commit 73db0a54e5
2 changed files with 11 additions and 0 deletions

View File

@@ -97,6 +97,10 @@ check "p:.{top-left}" "%0"
check_ok select-pane -t p:0.%0
check "p:0.+" "1" '#{pane_index}' # next pane
check "p:0.-" "3" '#{pane_index}' # previous pane (wraps)
check_fail "can't find pane: +0" "p:0.+0"
check_fail "can't find pane: +foo" "p:0.+foo"
check_fail "can't find pane: -0" "p:0.-0"
check_fail "can't find pane: -foo" "p:0.-foo"
# --- last pane (!) --------------------------------------------------------
check_ok select-pane -t p:0.%2

View File

@@ -154,6 +154,13 @@ check "alpha:{previous}" "3"
check "alpha:!" "2" # last window
check "alpha:{last}" "2"
# Malformed relative offsets must fail rather than silently selecting the
# current window.
check_fail "can't find window: +0" "alpha:+0"
check_fail "can't find window: +foo" "alpha:+foo"
check_fail "can't find window: -0" "alpha:-0"
check_fail "can't find window: -foo" "alpha:-foo"
# --- combined and empty forms ---------------------------------------------
#
# Empty targets use the current pane from TMUX_PANE when there is no client.