git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: git@vger.kernel.org
Cc: Eric Wong <normalperson@yhbt.net>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 3/6] git svn info: tests: use test_cmp instead of git-diff
Date: Tue, 26 Aug 2008 21:32:34 +0200	[thread overview]
Message-ID: <1219779157-31602-4-git-send-email-trast@student.ethz.ch> (raw)
In-Reply-To: <1219779157-31602-3-git-send-email-trast@student.ethz.ch>

git-diff does not appear to return the correct exit values, and gives
a false success for more than half (!) of the tests due to the space
in "trash directory" which git-svn fails to encode.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 t/t9119-git-svn-info.sh |   44 ++++++++++++++++++++++----------------------
 1 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh
index a70f2b9..7798dcc 100755
--- a/t/t9119-git-svn-info.sh
+++ b/t/t9119-git-svn-info.sh
@@ -60,7 +60,7 @@ test_expect_success 'setup repository and import' '
 test_expect_success 'info' "
 	(cd svnwc; svn info) > expected.info &&
 	(cd gitwc; git-svn info) > actual.info &&
-	git-diff expected.info actual.info
+	test_cmp expected.info actual.info
 	"
 
 test_expect_success 'info --url' '
@@ -70,7 +70,7 @@ test_expect_success 'info --url' '
 test_expect_success 'info .' "
 	(cd svnwc; svn info .) > expected.info-dot &&
 	(cd gitwc; git-svn info .) > actual.info-dot &&
-	git-diff expected.info-dot actual.info-dot
+	test_cmp expected.info-dot actual.info-dot
 	"
 
 test_expect_success 'info --url .' '
@@ -80,7 +80,7 @@ test_expect_success 'info --url .' '
 test_expect_success 'info file' "
 	(cd svnwc; svn info file) > expected.info-file &&
 	(cd gitwc; git-svn info file) > actual.info-file &&
-	git-diff expected.info-file actual.info-file
+	test_cmp expected.info-file actual.info-file
 	"
 
 test_expect_success 'info --url file' '
@@ -90,7 +90,7 @@ test_expect_success 'info --url file' '
 test_expect_success 'info directory' "
 	(cd svnwc; svn info directory) > expected.info-directory &&
 	(cd gitwc; git-svn info directory) > actual.info-directory &&
-	git-diff expected.info-directory actual.info-directory
+	test_cmp expected.info-directory actual.info-directory
 	"
 
 test_expect_success 'info --url directory' '
@@ -100,7 +100,7 @@ test_expect_success 'info --url directory' '
 test_expect_success 'info symlink-file' "
 	(cd svnwc; svn info symlink-file) > expected.info-symlink-file &&
 	(cd gitwc; git-svn info symlink-file) > actual.info-symlink-file &&
-	git-diff expected.info-symlink-file actual.info-symlink-file
+	test_cmp expected.info-symlink-file actual.info-symlink-file
 	"
 
 test_expect_success 'info --url symlink-file' '
@@ -113,7 +113,7 @@ test_expect_success 'info symlink-directory' "
 		> expected.info-symlink-directory &&
 	(cd gitwc; git-svn info symlink-directory) \
 		> actual.info-symlink-directory &&
-	git-diff expected.info-symlink-directory actual.info-symlink-directory
+	test_cmp expected.info-symlink-directory actual.info-symlink-directory
 	"
 
 test_expect_success 'info --url symlink-directory' '
@@ -133,7 +133,7 @@ test_expect_success 'info added-file' "
 	cd .. &&
 	(cd svnwc; svn info added-file) > expected.info-added-file &&
 	(cd gitwc; git-svn info added-file) > actual.info-added-file &&
-	git-diff expected.info-added-file actual.info-added-file
+	test_cmp expected.info-added-file actual.info-added-file
 	"
 
 test_expect_success 'info --url added-file' '
@@ -155,7 +155,7 @@ test_expect_success 'info added-directory' "
 		> expected.info-added-directory &&
 	(cd gitwc; git-svn info added-directory) \
 		> actual.info-added-directory &&
-	git-diff expected.info-added-directory actual.info-added-directory
+	test_cmp expected.info-added-directory actual.info-added-directory
 	"
 
 test_expect_success 'info --url added-directory' '
@@ -177,7 +177,7 @@ test_expect_success 'info added-symlink-file' "
 		> expected.info-added-symlink-file &&
 	(cd gitwc; git-svn info added-symlink-file) \
 		> actual.info-added-symlink-file &&
-	git-diff expected.info-added-symlink-file \
+	test_cmp expected.info-added-symlink-file \
 		 actual.info-added-symlink-file
 	"
 
@@ -200,7 +200,7 @@ test_expect_success 'info added-symlink-directory' "
 		> expected.info-added-symlink-directory &&
 	(cd gitwc; git-svn info added-symlink-directory) \
 		> actual.info-added-symlink-directory &&
-	git-diff expected.info-added-symlink-directory \
+	test_cmp expected.info-added-symlink-directory \
 		 actual.info-added-symlink-directory
 	"
 
@@ -227,7 +227,7 @@ test_expect_success 'info deleted-file' "
 	(cd gitwc; git-svn info file) |
 	sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
 		> actual.info-deleted-file &&
-	git-diff expected.info-deleted-file actual.info-deleted-file
+	test_cmp expected.info-deleted-file actual.info-deleted-file
 	"
 
 test_expect_success 'info --url file (deleted)' '
@@ -248,7 +248,7 @@ test_expect_success 'info deleted-directory' "
 	(cd gitwc; git-svn info directory) |
 	sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
 		> actual.info-deleted-directory &&
-	git-diff expected.info-deleted-directory actual.info-deleted-directory
+	test_cmp expected.info-deleted-directory actual.info-deleted-directory
 	"
 
 test_expect_success 'info --url directory (deleted)' '
@@ -269,7 +269,7 @@ test_expect_success 'info deleted-symlink-file' "
 	(cd gitwc; git-svn info symlink-file) |
 	sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
 		> actual.info-deleted-symlink-file &&
-	git-diff expected.info-deleted-symlink-file \
+	test_cmp expected.info-deleted-symlink-file \
 		 actual.info-deleted-symlink-file
 	"
 
@@ -291,7 +291,7 @@ test_expect_success 'info deleted-symlink-directory' "
 	(cd gitwc; git-svn info symlink-directory) |
 	sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
 		 > actual.info-deleted-symlink-directory &&
-	git-diff expected.info-deleted-symlink-directory \
+	test_cmp expected.info-deleted-symlink-directory \
 		 actual.info-deleted-symlink-directory
 	"
 
@@ -309,13 +309,13 @@ test_expect_success 'info unknown-file' "
 	ptouch gitwc/unknown-file svnwc/unknown-file &&
 	(cd svnwc; svn info unknown-file) 2> expected.info-unknown-file &&
 	(cd gitwc; git-svn info unknown-file) 2> actual.info-unknown-file &&
-	git-diff expected.info-unknown-file actual.info-unknown-file
+	test_cmp expected.info-unknown-file actual.info-unknown-file
 	"
 
 test_expect_success 'info --url unknown-file' '
 	test -z "$(cd gitwc; git-svn info --url unknown-file \
 			2> ../actual.info--url-unknown-file)" &&
-	git-diff expected.info-unknown-file actual.info--url-unknown-file
+	test_cmp expected.info-unknown-file actual.info--url-unknown-file
 	'
 
 test_expect_success 'info unknown-directory' "
@@ -326,13 +326,13 @@ test_expect_success 'info unknown-directory' "
 		2> expected.info-unknown-directory &&
 	(cd gitwc; git-svn info unknown-directory) \
 		2> actual.info-unknown-directory &&
-	git-diff expected.info-unknown-directory actual.info-unknown-directory
+	test_cmp expected.info-unknown-directory actual.info-unknown-directory
 	"
 
 test_expect_success 'info --url unknown-directory' '
 	test -z "$(cd gitwc; git-svn info --url unknown-directory \
 			2> ../actual.info--url-unknown-directory)" &&
-	git-diff expected.info-unknown-directory \
+	test_cmp expected.info-unknown-directory \
 		 actual.info--url-unknown-directory
 	'
 
@@ -348,14 +348,14 @@ test_expect_success 'info unknown-symlink-file' "
 		2> expected.info-unknown-symlink-file &&
 	(cd gitwc; git-svn info unknown-symlink-file) \
 		2> actual.info-unknown-symlink-file &&
-	git-diff expected.info-unknown-symlink-file \
+	test_cmp expected.info-unknown-symlink-file \
 		 actual.info-unknown-symlink-file
 	"
 
 test_expect_success 'info --url unknown-symlink-file' '
 	test -z "$(cd gitwc; git-svn info --url unknown-symlink-file \
 			2> ../actual.info--url-unknown-symlink-file)" &&
-	git-diff expected.info-unknown-symlink-file \
+	test_cmp expected.info-unknown-symlink-file \
 		 actual.info--url-unknown-symlink-file
 	'
 
@@ -372,14 +372,14 @@ test_expect_success 'info unknown-symlink-directory' "
 		2> expected.info-unknown-symlink-directory &&
 	(cd gitwc; git-svn info unknown-symlink-directory) \
 		2> actual.info-unknown-symlink-directory &&
-	git-diff expected.info-unknown-symlink-directory \
+	test_cmp expected.info-unknown-symlink-directory \
 		 actual.info-unknown-symlink-directory
 	"
 
 test_expect_success 'info --url unknown-symlink-directory' '
 	test -z "$(cd gitwc; git-svn info --url unknown-symlink-directory \
 			2> ../actual.info--url-unknown-symlink-directory)" &&
-	git-diff expected.info-unknown-symlink-directory \
+	test_cmp expected.info-unknown-symlink-directory \
 		 actual.info--url-unknown-symlink-directory
 	'
 
-- 
1.6.0.1.96.g9307e.dirty

  reply	other threads:[~2008-08-26 19:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26 19:32 [PATCH 0/6] 'git svn info' fixes Thomas Rast
2008-08-26 19:32 ` [PATCH 1/6] git svn info: tests: let 'init' test run with SVN 1.5 Thomas Rast
2008-08-26 19:32   ` [PATCH 2/6] git svn info: tests: do not use set -e Thomas Rast
2008-08-26 19:32     ` Thomas Rast [this message]
2008-08-26 19:32       ` [PATCH 4/6] git svn info: tests: fix ptouch argument order in setup Thomas Rast
2008-08-26 19:32         ` [PATCH 5/6] git svn info: make info relative to the current directory Thomas Rast
2008-08-26 19:32           ` [PATCH 6/6] git svn info: always quote URLs in 'info' output Thomas Rast
2008-08-27  9:43             ` Eric Wong
2008-08-27  9:53 ` [PATCH 0/6] 'git svn info' fixes Eric Wong
2008-08-28  8:30   ` Thomas Rast
2008-08-29  8:16     ` Eric Wong
2008-08-29 13:42       ` [PATCH 0/2] *** SUBJECT HERE *** Thomas Rast
2008-08-29 13:42         ` [PATCH 1/2] git-svn: match SVN 1.5 behaviour of info' on unknown item Thomas Rast
2008-08-29 13:42           ` [PATCH 2/2] git-svn: fix 'info' tests for unknown items Thomas Rast
2008-08-30  1:03         ` [PATCH 0/2] 'git svn info' fixes Eric Wong
2008-09-01  9:46           ` Thomas Rast
2008-09-01 22:58             ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1219779157-31602-4-git-send-email-trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).