summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers/test-hg.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-24 21:29:21 -0500
committerJunio C Hamano <gitster@pobox.com>2013-05-28 07:59:19 -0700
commit531594e5aad738fa46cfad417bcef0fbd1520fbd (patch)
tree8f9d0482a995978f4b5904a7576baf81ffeae711 /contrib/remote-helpers/test-hg.sh
parentdde67d794c2600fee74aef289332257742f28cfa (diff)
downloadgit-531594e5aad738fa46cfad417bcef0fbd1520fbd.tar.gz
remote-helpers: tests: general improvements
So that we don't need a temporary directory. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers/test-hg.sh')
-rwxr-xr-xcontrib/remote-helpers/test-hg.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
index e278dfde0f..f986db0ff0 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -122,6 +122,9 @@ test_expect_success 'update bookmark' '
hg -R hgrepo bookmarks | egrep "devel[ ]+3:"
'
+# cleanup previous stuff
+rm -rf hgrepo
+
author_test () {
echo $1 >> content &&
hg commit -u "$2" -m "add $1" &&
@@ -129,8 +132,7 @@ author_test () {
}
test_expect_success 'authors' '
- mkdir -p tmp && cd tmp &&
- test_when_finished "cd .. && rm -rf tmp" &&
+ test_when_finished "rm -rf hgrepo gitrepo" &&
(
hg init hgrepo &&
@@ -139,6 +141,7 @@ test_expect_success 'authors' '
touch content &&
hg add content &&
+ > ../expected &&
author_test alpha "" "H G Wells <wells@example.com>" &&
author_test beta "test" "test <unknown>" &&
author_test beta "test <test@example.com> (comment)" "test <test@example.com>" &&