git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brandon Casey <drafnel@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, hilco.wijbenga@gmail.com,
	david@porkrind.org, Brandon Casey <drafnel@gmail.com>
Subject: [PATCH 1/4] t/t3905: use the name 'actual' for test output, swap arguments to test_cmp
Date: Fri, 26 Aug 2011 19:59:24 -0500	[thread overview]
Message-ID: <1314406767-17832-1-git-send-email-drafnel@gmail.com> (raw)

It is common practice in the git test suite to use the file names 'actual'
and 'expect' to hold the actual and expected output of commands.  So change
the name 'output' to 'actual'.

Additionally, swap the order of arguments to test_cmp when comparing
expected output and actual output so that if diff output is produced, it
describes how the actual output differs from what was expected rather than
the other way around.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 t/t3905-stash-include-untracked.sh |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index 4f2eedf..adc2524 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -23,13 +23,13 @@ test_expect_success 'stash save --include-untracked some dirty working directory
 '
 
 cat > expect <<EOF
+?? actual
 ?? expect
-?? output
 EOF
 
 test_expect_success 'stash save --include-untracked cleaned the untracked files' '
-	git status --porcelain > output
-	test_cmp output expect
+	git status --porcelain >actual
+	test_cmp expect actual
 '
 
 cat > expect.diff <<EOF
@@ -47,10 +47,10 @@ EOF
 
 test_expect_success 'stash save --include-untracked stashed the untracked files' '
 	test "!" -f file2 &&
-	git diff HEAD..stash^3 -- file2 > output &&
-	test_cmp output expect.diff &&
-	git ls-tree --name-only stash^3: > output &&
-	test_cmp output expect.lstree
+	git diff HEAD..stash^3 -- file2 >actual &&
+	test_cmp expect.diff actual &&
+	git ls-tree --name-only stash^3: >actual &&
+	test_cmp expect.lstree actual
 '
 test_expect_success 'stash save --patch --include-untracked fails' '
 	test_must_fail git stash --patch --include-untracked
@@ -64,15 +64,15 @@ git clean --force --quiet
 
 cat > expect <<EOF
  M file
+?? actual
 ?? expect
 ?? file2
-?? output
 EOF
 
 test_expect_success 'stash pop after save --include-untracked leaves files untracked again' '
 	git stash pop &&
-	git status --porcelain > output
-	test_cmp output expect
+	git status --porcelain >actual
+	test_cmp expect actual
 '
 
 git clean --force --quiet
@@ -96,8 +96,8 @@ EOF
 
 test_expect_success 'stash save --include-untracked dirty index got stashed' '
 	git stash pop --index &&
-	git diff --cached > output &&
-	test_cmp output expect
+	git diff --cached >actual &&
+	test_cmp expect actual
 '
 
 git reset > /dev/null
-- 
1.7.6

             reply	other threads:[~2011-08-27  1:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27  0:59 Brandon Casey [this message]
2011-08-27  0:59 ` [PATCH 2/4] git-stash.sh: fix typo in error message Brandon Casey
2011-08-27  0:59 ` [PATCH 3/4] t/t3905: add missing '&&' linkage Brandon Casey
2011-08-27  0:59 ` [PATCH 4/4] git-stash: remove untracked/ignored directories when stashed Brandon Casey
2011-08-27  1:04   ` Hilco Wijbenga
2011-08-27 18:50 ` [PATCH 1/4] t/t3905: use the name 'actual' for test output, swap arguments to test_cmp Junio C Hamano

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=1314406767-17832-1-git-send-email-drafnel@gmail.com \
    --to=drafnel@gmail.com \
    --cc=david@porkrind.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hilco.wijbenga@gmail.com \
    /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).