tests/test-dispatch
author Javi Merino <cibervicho@gmail.com>
Wed, 19 May 2010 18:06:35 +0200
changeset 11266 2b440bb8a66b
parent 8637 c88c8d59979f
child 11675 f92f8921a5cc
permissions -rwxr-xr-x
Fixed a bashism with the use of $RANDOM in hgeditor. The variable $RANDOM is not POSIX so a portable /bin/sh may not define it. When creating a directory with a random name it's better to use mktemp, which, even though is not POSIX, exists in common Unixes including Linux, OpenBSD, FreeBSD and MacOS X.

#!/bin/sh
# test command parsing and dispatch

"$TESTDIR/hghave" no-outer-repo || exit 80

hg init a
cd a
echo a > a
hg ci -Ama

echo "# missing arg"
hg cat

echo '% [defaults]'
hg cat a
cat >> $HGRCPATH <<EOF
[defaults]
cat = -r null
EOF
hg cat a

echo '% no repo'
cd ..
hg cat

exit 0