mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Try to start writing test scripts.
This commit is contained in:
parent
9d041d8e6c
commit
1b221a56ea
29
regress/if-shell-TERM.sh
Normal file
29
regress/if-shell-TERM.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 882
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=../tmux
|
||||
TMUX="$TEST_TMUX -Ltest"
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
TMP=$(mktemp)
|
||||
trap "rm -f $TMP" 0 1 15
|
||||
|
||||
cat <<EOF >$TMP
|
||||
if '[ "\$TERM" = "xterm" ]' \
|
||||
'set -g default-terminal "vt220"' \
|
||||
'set -g default-terminal "ansi"'
|
||||
EOF
|
||||
|
||||
TERM=xterm $TMUX -f$TMP new -d "echo \"#\$TERM\" >>$TMP" || exit 1
|
||||
sleep 1 && [ "$(tail -1 $TMP)" = "#vt220" ] || exit 1
|
||||
|
||||
TERM=screen $TMUX -f$TMP new -d "echo \"#\$TERM\" >>$TMP" || exit 1
|
||||
sleep 1 && [ "$(tail -1 $TMP)" = "#ansi" ] || exit 1
|
||||
|
||||
$TMUX has 2>/dev/null && exit 1
|
||||
|
||||
exit 0
|
25
regress/if-shell-error.sh
Normal file
25
regress/if-shell-error.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 883
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=../tmux
|
||||
TMUX="$TEST_TMUX -Ltest"
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
TMP=$(mktemp)
|
||||
trap "rm -f $TMP" 0 1 15
|
||||
|
||||
cat <<EOF >$TMP
|
||||
if 'true' 'wibble wobble'
|
||||
EOF
|
||||
|
||||
$TMUX -f$TMP new -d || exit 1
|
||||
sleep 1
|
||||
E=$($TMUX display -p '#{pane_in_mode}')
|
||||
$TMUX kill-server 2>/dev/null
|
||||
[ "$E" = "1" ] || exit 1
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user