mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 19:58:48 +00:00
Tests for some new session and new window bits.
This commit is contained in:
parent
0daeefefdb
commit
6b2d850e54
27
regress/new-session-base-index.sh
Normal file
27
regress/new-session-base-index.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
# new session base-index
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
||||
TMUX="$TEST_TMUX -Ltest"
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
TMP=$(mktemp)
|
||||
trap "rm -f $TMP" 0 1 15
|
||||
|
||||
cat <<EOF >$TMP
|
||||
set -g base-index 100
|
||||
new
|
||||
set base-index 200
|
||||
neww
|
||||
EOF
|
||||
|
||||
$TMUX -f$TMP start
|
||||
echo $($TMUX lsw -F'#{window_index}') >$TMP
|
||||
(echo "100 200"|cmp -s - $TMP) || exit 1
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
exit 0
|
25
regress/new-session-command.sh
Normal file
25
regress/new-session-command.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# new session command
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
||||
TMUX="$TEST_TMUX -Ltest"
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
TMP=$(mktemp)
|
||||
trap "rm -f $TMP" 0 1 15
|
||||
|
||||
cat <<EOF >$TMP
|
||||
new sleep 101
|
||||
new -- sleep 102
|
||||
new "sleep 103"
|
||||
EOF
|
||||
|
||||
$TMUX -f$TMP start
|
||||
[ $($TMUX ls|wc -l) -eq 3 ] || exit 1
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
exit 0
|
54
regress/new-session-environment.sh
Normal file
54
regress/new-session-environment.sh
Normal file
@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
# new session environment
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
||||
TMUX="$TEST_TMUX -Ltest"
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
TMP=$(mktemp)
|
||||
SCRIPT=$(mktemp)
|
||||
trap "rm -f $TMP $SCRIPT" 0 1 15
|
||||
|
||||
cat <<EOF >$SCRIPT
|
||||
(
|
||||
echo TERM=\$TERM
|
||||
echo PWD=\$(pwd)
|
||||
echo PATH=\$PATH
|
||||
echo SHELL=\$SHELL
|
||||
echo TEST=\$TEST
|
||||
) >$TMP
|
||||
EOF
|
||||
|
||||
cat <<EOF >$TMP
|
||||
new -- /bin/sh $SCRIPT
|
||||
EOF
|
||||
|
||||
(cd /; env -i TERM=ansi TEST=test1 PATH=1 SHELL=/bin/sh \
|
||||
$TMUX -f$TMP start) || exit 1
|
||||
sleep 1
|
||||
(cat <<EOF|cmp -s - $TMP) || exit 1
|
||||
TERM=screen
|
||||
PWD=/
|
||||
PATH=1
|
||||
SHELL=/bin/sh
|
||||
TEST=test1
|
||||
EOF
|
||||
|
||||
(cd /; env -i TERM=ansi TEST=test2 PATH=2 SHELL=/bin/sh \
|
||||
$TMUX new -d -- /bin/sh $SCRIPT) || exit 1
|
||||
sleep 1
|
||||
(cat <<EOF|cmp -s - $TMP) || exit 1
|
||||
TERM=screen
|
||||
PWD=/
|
||||
PATH=2
|
||||
SHELL=/bin/sh
|
||||
TEST=test2
|
||||
EOF
|
||||
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
exit 0
|
26
regress/new-window-command.sh
Normal file
26
regress/new-window-command.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
# new session command
|
||||
|
||||
PATH=/bin:/usr/bin
|
||||
TERM=screen
|
||||
|
||||
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
|
||||
TMUX="$TEST_TMUX -Ltest"
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
TMP=$(mktemp)
|
||||
trap "rm -f $TMP" 0 1 15
|
||||
|
||||
cat <<EOF >$TMP
|
||||
new
|
||||
neww sleep 101
|
||||
neww -- sleep 102
|
||||
neww "sleep 103"
|
||||
EOF
|
||||
|
||||
$TMUX -f$TMP start
|
||||
[ $($TMUX lsw|wc -l) -eq 4 ] || exit 1
|
||||
$TMUX kill-server 2>/dev/null
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user