git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
To: git@vger.kernel.org, gitster@pobox.com
Cc: mj@ucw.cz, "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Subject: [PATCH 1/4] test: modernize style of t4006
Date: Tue,  1 May 2012 19:10:12 +0200	[thread overview]
Message-ID: <1335892215-21331-2-git-send-email-zbyszek@in.waw.pl> (raw)
In-Reply-To: <1335892215-21331-1-git-send-email-zbyszek@in.waw.pl>

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
---
 t/t4006-diff-mode.sh |   32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index ff8c2f7..c8f5180 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -8,23 +8,21 @@ test_description='Test mode change diffs.
 '
 . ./test-lib.sh
 
-test_expect_success \
-    'setup' \
-    'echo frotz >rezrov &&
-     git update-index --add rezrov &&
-     tree=`git write-tree` &&
-     echo $tree'
-
-test_expect_success \
-    'chmod' \
-    'test_chmod +x rezrov &&
-     git diff-index $tree >current'
-
-sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check
-echo ":100644 100755 X X M	rezrov" >expected
+test_expect_success 'setup' '
+	echo frotz >rezrov &&
+	git update-index --add rezrov &&
+	tree=`git write-tree` &&
+	echo $tree
+'
 
-test_expect_success \
-    'verify' \
-    'test_cmp expected check'
+# $_x40 is defined in test-lib.sh
+sed_script='s/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /'
+test_expect_success 'chmod' '
+	test_chmod +x rezrov &&
+	git diff-index $tree >current &&
+	sed -e "$sed_script" <current >check &&
+	echo ":100644 100755 X X M	rezrov" >expected &&
+	test_cmp expected check
+'
 
 test_done
-- 
1.7.10.539.g288dd

  reply	other threads:[~2012-05-01 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-01 17:10 [PATCH 0/4] report chmod'ed binary files the same as text files Zbigniew Jędrzejewski-Szmek
2012-05-01 17:10 ` Zbigniew Jędrzejewski-Szmek [this message]
2012-05-01 18:00   ` [PATCH 1/4] test: modernize style of t4006 Junio C Hamano
2012-05-01 19:55     ` Zbigniew Jędrzejewski-Szmek
2012-05-01 17:10 ` [PATCH 2/4] tests: check --[short]stat output after chmod Zbigniew Jędrzejewski-Szmek
2012-05-02  7:36   ` Johannes Sixt
2012-05-01 17:10 ` [PATCH 3/4] diff --stat: report chmoded binary files like text files Zbigniew Jędrzejewski-Szmek
2012-05-01 18:27   ` Junio C Hamano
2012-05-01 19:39     ` Zbigniew Jędrzejewski-Szmek
2012-05-01 17:10 ` [PATCH 4/4] diff --stat: do not run diff on indentical files Zbigniew Jędrzejewski-Szmek
2012-05-03 11:45 ` [PATCH 0/4] report chmod'ed binary files the same as text files Martin Mares

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=1335892215-21331-2-git-send-email-zbyszek@in.waw.pl \
    --to=zbyszek@in.waw.pl \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mj@ucw.cz \
    /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).