remote-hg: add check_bookmark() test helper
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 25 May 2013 02:29:37 +0000 (21:29 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 May 2013 14:59:56 +0000 (07:59 -0700)
And check in a more proper way.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/remote-helpers/test-hg.sh
index d244e236f6eca721f69e7f6345f6cf2f1a3f30df..4e56640101a0f72d878366cff6ff50ff419948e2 100755 (executable)
@@ -32,6 +32,12 @@ check_branch () {
        test_cmp expected actual
 }
 
+check_bookmark () {
+       echo $3 > expected &&
+       hg -R $1 log -r "bookmark('$2')" --template '{desc}\n' > actual &&
+       test_cmp expected actual
+}
+
 setup () {
        (
        echo "[ui]"
@@ -108,7 +114,7 @@ test_expect_success 'update bookmark' '
        git push --quiet
        ) &&
 
-       hg -R hgrepo bookmarks | egrep "devel[   ]+3:"
+       check_bookmark hgrepo devel devel
 '
 
 # cleanup previous stuff