git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Johannes Sixt" <j.sixt@viscovery.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/4] t7004-tag.sh: re-arrange git tag comment for clarity
Date: Sun, 14 Nov 2010 14:44:15 +0000	[thread overview]
Message-ID: <1289745857-16704-3-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1289745857-16704-1-git-send-email-avarab@gmail.com>

Split the "message in editor has initial comment" test into three
tests. The motivation is to be able to only skip the middle part under
NO_GETTEXT_POISON.

In addition the return value of 'git tag' was being returned. We now
check that it's non-zero. I used ! instead of test_must_fail so that
the GIT_EDITOR variable was only used in this command invocation, and
because the surrounding tests use this style.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t7004-tag.sh |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index ac943f5..700b556 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1051,13 +1051,23 @@ test_expect_success \
 
 test_expect_success \
 	'message in editor has initial comment' '
-	GIT_EDITOR=cat git tag -a initial-comment > actual
+	! (GIT_EDITOR=cat git tag -a initial-comment > actual)
+'
+
+test_expect_success \
+	'message in editor has initial comment: first line' '
 	# check the first line --- should be empty
-	first=$(sed -e 1q <actual) &&
-	test -z "$first" &&
+	echo >first.expect &&
+	sed -e 1q <actual >first.actual &&
+	test_cmp first.expect first.actual
+'
+
+test_expect_success \
+	'message in editor has initial comment: remainder' '
 	# remove commented lines from the remainder -- should be empty
-	rest=$(sed -e 1d -e '/^#/d' <actual) &&
-	test -z "$rest"
+	>rest.expect
+	sed -e 1d -e '/^#/d' <actual >rest.actual &&
+	test_cmp rest.expect rest.actual
 '
 
 get_tag_header reuse $commit commit $time >expect
-- 
1.7.2.3

  parent reply	other threads:[~2010-11-14 14:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14 14:44 [PATCH 0/4] [PULL] ab/i18n-prereqs, prerequisites for ab/i18n Ævar Arnfjörð Bjarmason
2010-11-14 14:44 ` [PATCH 1/4] Makefile: move "Platform specific tweaks" above LIB_{H,OBJS} Ævar Arnfjörð Bjarmason
2010-11-14 17:23   ` Jonathan Nieder
2010-11-14 17:51     ` Ævar Arnfjörð Bjarmason
2010-11-14 18:51       ` Jonathan Nieder
2010-11-15 16:07         ` Junio C Hamano
2010-11-15 16:11           ` Jonathan Nieder
2010-11-15 16:16             ` Ævar Arnfjörð Bjarmason
2010-11-14 19:12       ` Junio C Hamano
2010-11-14 17:53     ` Jonathan Nieder
2010-11-14 19:08   ` Junio C Hamano
2010-11-14 14:44 ` Ævar Arnfjörð Bjarmason [this message]
2010-11-14 17:32   ` [PATCH 2/4] t7004-tag.sh: re-arrange git tag comment for clarity Jonathan Nieder
2010-11-14 17:57     ` Ævar Arnfjörð Bjarmason
2010-11-14 14:44 ` [PATCH 3/4] tests: use test_cmp instead of piping to diff(1) Ævar Arnfjörð Bjarmason
2010-11-14 17:41   ` Jonathan Nieder
2010-11-14 14:44 ` [PATCH 4/4] builtin: use builtin.h for all builtin commands Ævar Arnfjörð Bjarmason
2010-11-14 15:01   ` Sverre Rabbelier
2010-11-14 15:11     ` Ævar Arnfjörð Bjarmason
2010-11-14 18:55     ` Junio C Hamano
2010-11-14 17:47   ` Jonathan Nieder
2010-11-17 19:54   ` Junio C Hamano
2010-11-17 20:08     ` Ævar Arnfjörð Bjarmason
2010-11-17 20:15       ` Jonathan Nieder
2010-11-14 17:50 ` [PATCH 0/4] [PULL] ab/i18n-prereqs, prerequisites for ab/i18n Jonathan Nieder

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=1289745857-16704-3-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.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).