src/tests: clean up duplicate code
This commit is contained in:
@@ -6,14 +6,7 @@
|
||||
# resize them. But it works!
|
||||
#
|
||||
|
||||
fail()
|
||||
{
|
||||
printf "$@" 2>&1
|
||||
exit 99
|
||||
}
|
||||
|
||||
|
||||
|
||||
. $(dirname $0)/e2e-test-subrs
|
||||
PATH=$PATH:.:$srcdir
|
||||
# Top-level wrapper.
|
||||
if [ $# -eq 0 ]; then
|
||||
@@ -21,39 +14,6 @@ if [ $# -eq 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
sleepf()
|
||||
{
|
||||
(sleep .1 || sleep 1) > /dev/null 2>&1
|
||||
}
|
||||
|
||||
seq()
|
||||
{
|
||||
if [ $# -lt 1 -o $# -gt 3 ]; then
|
||||
echo "bad args" >&2
|
||||
fi
|
||||
first=$1
|
||||
incr=1
|
||||
last=0
|
||||
case $# in
|
||||
3)
|
||||
incr=$2
|
||||
last=$3
|
||||
;;
|
||||
2)
|
||||
last=$2
|
||||
;;
|
||||
1)
|
||||
;;
|
||||
esac
|
||||
while :; do
|
||||
printf '%d\n' $first
|
||||
first=$(expr $first + $incr)
|
||||
if [ $first -gt $last ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
tmux_resize_commands()
|
||||
{
|
||||
hv=$1
|
||||
|
||||
Reference in New Issue
Block a user