tmux/regress/if-shell-error.sh

24 lines
420 B
Bash
Raw Normal View History

2017-04-25 12:37:03 +00:00
#!/bin/sh
# 883
2017-04-25 12:50:44 +00:00
# if-shell with an error should not core :-)
2017-04-25 12:37:03 +00:00
PATH=/bin:/usr/bin
TERM=screen
2017-04-25 13:30:58 +00:00
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
2017-04-25 12:37:03 +00:00
TMUX="$TEST_TMUX -Ltest"
$TMUX kill-server 2>/dev/null
TMP=$(mktemp)
OUT=$(mktemp)
trap "rm -f $TMP $OUT" 0 1 15
2017-04-25 12:37:03 +00:00
cat <<EOF >$TMP
if 'true' 'wibble wobble'
EOF
$TMUX -f$TMP -C new <<EOF >$OUT
EOF
grep -q "^%config-error $TMP:1: $TMP:1: unknown command: wibble$" $OUT