git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Lars Schneider" <larsxschneider@gmail.com>
Subject: [PATCH 08/10] t2101: modernize test style
Date: Sun, 25 Mar 2018 19:20:53 +0000	[thread overview]
Message-ID: <20180325192055.841459-9-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20180325192055.841459-1-sandals@crustytoothpaste.net>

Most of our tests start with the opening quote of the test body on the
same line as the test_expect_success call.  Additionally, our tests are
usually indented with a single tab.  Update this test to be the same as
most others, which will make it easier to use inline heredocs in the
future.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/t2101-update-index-reupdate.sh | 52 ++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh
index c8bce8c2e4..168733a3c7 100755
--- a/t/t2101-update-index-reupdate.sh
+++ b/t/t2101-update-index-reupdate.sh
@@ -12,15 +12,16 @@ cat > expected <<\EOF
 100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0	file1
 100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0	file2
 EOF
-test_expect_success 'update-index --add' \
-	'echo hello world >file1 &&
-	 echo goodbye people >file2 &&
-	 git update-index --add file1 file2 &&
-	 git ls-files -s >current &&
-	 cmp current expected'
+test_expect_success 'update-index --add' '
+	echo hello world >file1 &&
+	echo goodbye people >file2 &&
+	git update-index --add file1 file2 &&
+	git ls-files -s >current &&
+	cmp current expected
+'
 
-test_expect_success 'update-index --again' \
-	'rm -f file1 &&
+test_expect_success 'update-index --again' '
+	rm -f file1 &&
 	echo hello everybody >file2 &&
 	if git update-index --again
 	then
@@ -29,16 +30,18 @@ test_expect_success 'update-index --again' \
 	else
 		echo happy - failed as expected
 	fi &&
-	 git ls-files -s >current &&
-	 cmp current expected'
+	git ls-files -s >current &&
+	cmp current expected
+'
 
 cat > expected <<\EOF
 100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0	file2
 EOF
-test_expect_success 'update-index --remove --again' \
-	'git update-index --remove --again &&
-	 git ls-files -s >current &&
-	 cmp current expected'
+test_expect_success 'update-index --remove --again' '
+	git update-index --remove --again &&
+	git ls-files -s >current &&
+	cmp current expected
+'
 
 test_expect_success 'first commit' 'git commit -m initial'
 
@@ -46,8 +49,8 @@ cat > expected <<\EOF
 100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0	dir1/file3
 100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0	file2
 EOF
-test_expect_success 'update-index again' \
-	'mkdir -p dir1 &&
+test_expect_success 'update-index again' '
+	mkdir -p dir1 &&
 	echo hello world >dir1/file3 &&
 	echo goodbye people >file2 &&
 	git update-index --add file2 dir1/file3 &&
@@ -55,30 +58,33 @@ test_expect_success 'update-index again' \
 	echo happy >dir1/file3 &&
 	git update-index --again &&
 	git ls-files -s >current &&
-	cmp current expected'
+	cmp current expected
+'
 
 cat > expected <<\EOF
 100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0	dir1/file3
 100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0	file2
 EOF
-test_expect_success 'update-index --update from subdir' \
-	'echo not so happy >file2 &&
+test_expect_success 'update-index --update from subdir' '
+	echo not so happy >file2 &&
 	(cd dir1 &&
 	cat ../file2 >file3 &&
 	git update-index --again
 	) &&
 	git ls-files -s >current &&
-	cmp current expected'
+	cmp current expected
+'
 
 cat > expected <<\EOF
 100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0	dir1/file3
 100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0	file2
 EOF
-test_expect_success 'update-index --update with pathspec' \
-	'echo very happy >file2 &&
+test_expect_success 'update-index --update with pathspec' '
+	echo very happy >file2 &&
 	cat file2 >dir1/file3 &&
 	git update-index --again dir1/ &&
 	git ls-files -s >current &&
-	cmp current expected'
+	cmp current expected
+'
 
 test_done

  parent reply	other threads:[~2018-03-25 19:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25 19:20 [PATCH 00/10] Hash-independent tests (part 1) brian m. carlson
2018-03-25 19:20 ` [PATCH 01/10] t1011: abstract away SHA-1-specific constants brian m. carlson
2018-03-25 19:20 ` [PATCH 02/10] t1304: " brian m. carlson
2018-03-25 19:20 ` [PATCH 03/10] t1300: " brian m. carlson
2018-03-25 19:20 ` [PATCH 04/10] t1405: sort reflog entries in a hash-independent way brian m. carlson
2018-03-26 22:18   ` Junio C Hamano
2018-03-26 23:02     ` brian m. carlson
2018-03-25 19:20 ` [PATCH 05/10] t1411: abstract away SHA-1-specific constants brian m. carlson
2018-03-25 19:20 ` [PATCH 06/10] t1507: " brian m. carlson
2018-03-25 19:20 ` [PATCH 07/10] t2020: abstract away SHA-1 specific constants brian m. carlson
2018-03-25 19:20 ` brian m. carlson [this message]
2018-03-25 19:20 ` [PATCH 09/10] t2101: abstract away SHA-1-specific constants brian m. carlson
2018-03-25 19:20 ` [PATCH 10/10] t2107: " brian m. carlson
2018-03-26  2:10 ` [PATCH 00/10] Hash-independent tests (part 1) Eric Sunshine
2018-03-26  4:48   ` Junio C Hamano
2018-03-27 14:40     ` Johannes Schindelin
2018-03-28 16:58       ` Junio C Hamano
2018-03-29 14:01         ` Johannes Schindelin
2018-03-26 22:27   ` brian m. carlson
2018-03-27 14:30 ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20180325192055.841459-9-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=pclouds@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).