src/tests: clean up duplicate code

This commit is contained in:
John Hood
2016-02-24 00:43:56 -05:00
parent ed92637f25
commit 49a4106ae4
17 changed files with 88 additions and 458 deletions
+1 -41
View File
@@ -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