diff --git a/regress/targets-panes.sh b/regress/targets-panes.sh index 9ea936173..6ec5ffe7d 100644 --- a/regress/targets-panes.sh +++ b/regress/targets-panes.sh @@ -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 diff --git a/regress/targets.sh b/regress/targets.sh index 75ee3dbb8..768feda07 100644 --- a/regress/targets.sh +++ b/regress/targets.sh @@ -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.