Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 9/9] git-status: adjust tests
Date: Sat, 15 Aug 2009 15:39:57 -0700	[thread overview]
Message-ID: <1250375997-10657-10-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1250375997-10657-9-git-send-email-gitster@pobox.com>

There are some tests that expect "git status" to exit with non-zero status
when there is something staged.  Some tests expect "git status path..." to
show the status for a partial commit.

For these, replace "git status" with "git commit --dry-run".  For the
ones that do not attempt a dry-run of a partial commit that check the
output from the command, check the output from "git status" as well, as
they should be identical.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * Kept separate for easier review; shows the extent of damage from the
   change in semantics rather well.

 t/t6040-tracking-info.sh    |    2 +-
 t/t7060-wtstatus.sh         |    8 +++++---
 t/t7506-status-submodule.sh |    6 +++---
 t/t7508-status.sh           |   12 +++++++-----
 4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 00e1de9..664b0f8 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -69,7 +69,7 @@ test_expect_success 'status' '
 		cd test &&
 		git checkout b1 >/dev/null &&
 		# reports nothing to commit
-		test_must_fail git status
+		test_must_fail git commit --dry-run
 	) >actual &&
 	grep "have 1 and 1 different" actual
 '
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index 1044aa6..7b5db80 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -50,9 +50,11 @@ test_expect_success 'M/D conflict does not segfault' '
 		git rm foo &&
 		git commit -m delete &&
 		test_must_fail git merge master &&
-		test_must_fail git status > ../actual
-	) &&
-	test_cmp expect actual
+		test_must_fail git commit --dry-run >../actual &&
+		test_cmp ../expect ../actual &&
+		git status >../actual &&
+		test_cmp ../expect ../actual
+	)
 '
 
 test_done
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index d9a08aa..3ca17ab 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -19,8 +19,8 @@ test_expect_success 'status clean' '
 	git status |
 	grep "nothing to commit"
 '
-test_expect_success 'status -a clean' '
-	git status -a |
+test_expect_success 'commit --dry-run -a clean' '
+	git commit --dry-run -a |
 	grep "nothing to commit"
 '
 test_expect_success 'rm submodule contents' '
@@ -31,7 +31,7 @@ test_expect_success 'status clean (empty submodule dir)' '
 	grep "nothing to commit"
 '
 test_expect_success 'status -a clean (empty submodule dir)' '
-	git status -a |
+	git commit --dry-run -a |
 	grep "nothing to commit"
 '
 
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 93f875f..1173dbb 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -248,8 +248,8 @@ cat <<EOF >expect
 #	output
 #	untracked
 EOF
-test_expect_success 'status of partial commit excluding new file in index' '
-	git status dir1/modified >output &&
+test_expect_success 'dry-run of partial commit excluding new file in index' '
+	git commit --dry-run dir1/modified >output &&
 	test_cmp expect output
 '
 
@@ -358,7 +358,9 @@ EOF
 test_expect_success 'status submodule summary (clean submodule)' '
 	git commit -m "commit submodule" &&
 	git config status.submodulesummary 10 &&
-	test_must_fail git status >output &&
+	test_must_fail git commit --dry-run >output &&
+	test_cmp expect output &&
+	git status >output &&
 	test_cmp expect output
 '
 
@@ -391,9 +393,9 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success 'status submodule summary (--amend)' '
+test_expect_success 'commit --dry-run submodule summary (--amend)' '
 	git config status.submodulesummary 10 &&
-	git status --amend >output &&
+	git commit --dry-run --amend >output &&
 	test_cmp expect output
 '
 
-- 
1.6.4.224.g3be84

  reply	other threads:[~2009-08-15 22:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 22:39 [PATCH 0/9] "git status" that is not "git commit --dry-run" Junio C Hamano
2009-08-15 22:39 ` [PATCH 1/9] Documentation/git-commit.txt: describe --dry-run Junio C Hamano
2009-08-15 22:39   ` [PATCH 2/9] git commit --dry-run -v: show diff in color when asked Junio C Hamano
2009-08-15 22:39     ` [PATCH 3/9] git stat: the beginning Junio C Hamano
2009-08-15 22:39       ` [PATCH 4/9] git stat: honor relative paths setting Junio C Hamano
2009-08-15 22:39         ` [PATCH 5/9] git stat: show traditional status headers and trailers as well Junio C Hamano
2009-08-15 22:39           ` [PATCH 6/9] git stat: pathspec limits, unlike traditional "git status" Junio C Hamano
2009-08-15 22:39             ` [PATCH 7/9] git stat -s: short status output Junio C Hamano
2009-08-15 22:39               ` [PATCH 8/9] git status: not "commit --dry-run" anymore Junio C Hamano
2009-08-15 22:39                 ` Junio C Hamano [this message]
2009-08-17  8:57                 ` Thomas Rast

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=1250375997-10657-10-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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