{"thread":{"id":"30206","subject":"[PATCH] tests: modernise style: more uses of test_line_count","startedAt":"2012-04-11T11:24:01Z","lastAt":"2012-04-11T17:35:46Z","messageCount":4,"participants":["Stefano Lattarini","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"188947","messageId":"e701486509c3306420e6bcf82e7d0d79fb2e7ae1.1334143281.git.stefano.lattarini@gmail.com","threadId":"30206","inReplyTo":null,"subject":"[PATCH] tests: modernise style: more uses of test_line_count","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-04-11T11:24:01Z","receivedAt":"2012-04-11T11:24:01Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"Prefer:\n\n  test_line_count <OP> COUNT FILE\n\nover:\n\n  test $(wc -l <FILE) <OP> COUNT\n\n(or similar usages) in several tests.\n\nSigned-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n---\n\n This is a re-roll of a patch I first sent a month ago:\n <http://comments.gmane.org/gmane.comp.version-control.git/192745>\n \n That patch was stalled as \"not appropriate for this part of the release\n cycle\"; since Git 1.7.10 has now been released, I'm re-sending the patch,\n after having rebased it on latest master.\n\n Regards,\n   Stefano\n \n t/t1410-reflog.sh                    |   26 ++++++++------------------\n t/t2004-checkout-cache-temp.sh       |   20 ++++++++++----------\n t/t2030-unresolve-info.sh            |    2 +-\n t/t3415-rebase-autosquash.sh         |   16 ++++++++--------\n t/t3900-i18n-commit.sh               |    2 +-\n t/t4035-diff-quiet.sh                |   26 +++++++++++++-------------\n t/t5100-mailinfo.sh                  |    2 +-\n t/t5700-clone-reference.sh           |    4 ++--\n t/t5710-info-alternate.sh            |    2 +-\n t/t6006-rev-list-format.sh           |   13 +++++++------\n t/t6030-bisect-porcelain.sh          |    2 +-\n t/t6032-merge-large-rename.sh        |    2 +-\n t/t6042-merge-rename-corner-cases.sh |    2 +-\n t/t7201-co.sh                        |    4 ++--\n t/t7400-submodule-basic.sh           |    2 +-\n t/t7408-submodule-reference.sh       |    4 ++--\n t/t7502-commit.sh                    |    2 +-\n t/t9350-fast-export.sh               |    4 ++--\n t/t9400-git-cvsserver-server.sh      |    4 ++--\n 19 files changed, 65 insertions(+), 74 deletions(-)\n\ndiff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh\nindex 252fc82..236b13a 100755\n--- a/t/t1410-reflog.sh\n+++ b/t/t1410-reflog.sh\n@@ -100,8 +100,7 @@ test_expect_success setup '\n \n \tcheck_fsck &&\n \n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 4\n+\ttest_line_count = 4 .git/logs/refs/heads/master\n '\n \n test_expect_success rewind '\n@@ -117,8 +116,7 @@ test_expect_success rewind '\n \n \tcheck_have A B C D E F G H I J K L &&\n \n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 5\n+\ttest_line_count = 5 .git/logs/refs/heads/master\n '\n \n test_expect_success 'corrupt and check' '\n@@ -136,8 +134,7 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '\n \t\t--stale-fix \\\n \t\t--all &&\n \n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 5 &&\n+\ttest_line_count = 5 .git/logs/refs/heads/master &&\n \n \tcheck_fsck \"missing blob $F\"\n '\n@@ -150,8 +147,7 @@ test_expect_success 'reflog expire' '\n \t\t--stale-fix \\\n \t\t--all &&\n \n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 2 &&\n+\ttest_line_count = 2 .git/logs/refs/heads/master &&\n \n \tcheck_fsck \"dangling commit $K\"\n '\n@@ -217,9 +213,7 @@ test_expect_success 'delete' '\n test_expect_success 'rewind2' '\n \n \ttest_tick && git reset --hard HEAD~2 &&\n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 4\n-\n+\ttest_line_count = 4 .git/logs/refs/heads/master\n '\n \n test_expect_success '--expire=never' '\n@@ -228,9 +222,7 @@ test_expect_success '--expire=never' '\n \t\t--expire=never \\\n \t\t--expire-unreachable=never \\\n \t\t--all &&\n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 4\n-\n+\ttest_line_count = 4 .git/logs/refs/heads/master\n '\n \n test_expect_success 'gc.reflogexpire=never' '\n@@ -238,8 +230,7 @@ test_expect_success 'gc.reflogexpire=never' '\n \tgit config gc.reflogexpire never &&\n \tgit config gc.reflogexpireunreachable never &&\n \tgit reflog expire --verbose --all &&\n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 4\n+\ttest_line_count = 4 .git/logs/refs/heads/master\n '\n \n test_expect_success 'gc.reflogexpire=false' '\n@@ -247,8 +238,7 @@ test_expect_success 'gc.reflogexpire=false' '\n \tgit config gc.reflogexpire false &&\n \tgit config gc.reflogexpireunreachable false &&\n \tgit reflog expire --verbose --all &&\n-\tloglen=$(wc -l <.git/logs/refs/heads/master) &&\n-\ttest $loglen = 4 &&\n+\ttest_line_count = 4 .git/logs/refs/heads/master &&\n \n \tgit config --unset gc.reflogexpire &&\n \tgit config --unset gc.reflogexpireunreachable\ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 36cca14..0f4b289 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -40,7 +40,7 @@ test_expect_success \\\n rm -f path* .merge_* out .git/index &&\n git read-tree $t1 &&\n git checkout-index --temp -- path1 >out &&\n-test $(wc -l <out) = 1 &&\n+test_line_count = 1 out &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n@@ -51,7 +51,7 @@ test_expect_success \\\n rm -f path* .merge_* out .git/index &&\n git read-tree $t1 &&\n git checkout-index -a --temp >out &&\n-test $(wc -l <out) = 5 &&\n+test_line_count = 5 out &&\n for f in path0 path1 path3 path4 asubdir/path5\n do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n@@ -69,7 +69,7 @@ test_expect_success \\\n 'checkout one stage 2 to temporary file' '\n rm -f path* .merge_* out &&\n git checkout-index --stage=2 --temp -- path1 >out &&\n-test $(wc -l <out) = 1 &&\n+test_line_count = 1 out &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\n@@ -79,7 +79,7 @@ test_expect_success \\\n 'checkout all stage 2 to temporary files' '\n rm -f path* .merge_* out &&\n git checkout-index --all --stage=2 --temp >out &&\n-test $(wc -l <out) = 3 &&\n+test_line_count = 3 out &&\n for f in path1 path2 path4\n do\n \ttest $(grep $f out | cut \"-d\t\" -f2) = $f &&\n@@ -92,13 +92,13 @@ test_expect_success \\\n 'checkout all stages/one file to nothing' '\n rm -f path* .merge_* out &&\n git checkout-index --stage=all --temp -- path0 >out &&\n-test $(wc -l <out) = 0'\n+test_line_count = 0 out'\n \n test_expect_success \\\n 'checkout all stages/one file to temporary files' '\n rm -f path* .merge_* out &&\n git checkout-index --stage=all --temp -- path1 >out &&\n-test $(wc -l <out) = 1 &&\n+test_line_count = 1 out &&\n test $(cut \"-d\t\" -f2 out) = path1 &&\n cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test -f $s1 &&\n@@ -112,7 +112,7 @@ test_expect_success \\\n 'checkout some stages/one file to temporary files' '\n rm -f path* .merge_* out &&\n git checkout-index --stage=all --temp -- path2 >out &&\n-test $(wc -l <out) = 1 &&\n+test_line_count = 1 out &&\n test $(cut \"-d\t\" -f2 out) = path2 &&\n cut \"-d\t\" -f1 out | (read s1 s2 s3 &&\n test $s1 = . &&\n@@ -125,7 +125,7 @@ test_expect_success \\\n 'checkout all stages/all files to temporary files' '\n rm -f path* .merge_* out &&\n git checkout-index -a --stage=all --temp >out &&\n-test $(wc -l <out) = 5'\n+test_line_count = 5 out'\n \n test_expect_success \\\n '-- path0: no entry' '\n@@ -185,7 +185,7 @@ test_expect_success \\\n 'checkout --temp within subdir' '\n (cd asubdir &&\n  git checkout-index -a --stage=all >out &&\n- test $(wc -l <out) = 1 &&\n+ test_line_count = 1 out &&\n  test $(grep path5 out | cut \"-d\t\" -f2) = path5 &&\n  grep path5 out | cut \"-d\t\" -f1 | (read s1 s2 s3 &&\n  test -f ../$s1 &&\n@@ -203,7 +203,7 @@ t4=$(git write-tree) &&\n rm -f .git/index &&\n git read-tree $t4 &&\n git checkout-index --temp -a >out &&\n-test $(wc -l <out) = 1 &&\n+test_line_count = 1 out &&\n test $(cut \"-d\t\" -f2 out) = a &&\n p=$(cut \"-d\t\" -f1 out) &&\n test -f $p &&\ndiff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh\nindex cb7effe..f262065 100755\n--- a/t/t2030-unresolve-info.sh\n+++ b/t/t2030-unresolve-info.sh\n@@ -113,7 +113,7 @@ test_expect_success 'unmerge with plumbing' '\n \tprime_resolve_undo &&\n \tgit update-index --unresolve fi/le &&\n \tgit ls-files -u >actual &&\n-\ttest $(wc -l <actual) = 3\n+\ttest_line_count = 3 actual\n '\n \n test_expect_success 'rerere and rerere forget' '\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex b38be8e..5fc366a 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -33,7 +33,7 @@ test_auto_fixup () {\n \ttest_tick &&\n \tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest 3 = $(wc -l <actual) &&\n+\ttest_line_count = 3 actual\n \tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep first | wc -l)\n@@ -62,7 +62,7 @@ test_auto_squash () {\n \ttest_tick &&\n \tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest 3 = $(wc -l <actual) &&\n+\ttest_line_count = 3 actual\n \tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^ | grep first | wc -l)\n@@ -90,7 +90,7 @@ test_expect_success 'misspelled auto squash' '\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest 4 = $(wc -l <actual) &&\n+\ttest_line_count = 4 actual &&\n \tgit diff --exit-code final-missquash &&\n \ttest 0 = $(git rev-list final-missquash...HEAD | wc -l)\n '\n@@ -109,7 +109,7 @@ test_expect_success 'auto squash that matches 2 commits' '\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD~4 &&\n \tgit log --oneline >actual &&\n-\ttest 4 = $(wc -l <actual) &&\n+\ttest_line_count = 4 actual &&\n \tgit diff --exit-code final-multisquash &&\n \ttest 1 = \"$(git cat-file blob HEAD^^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&\n@@ -130,7 +130,7 @@ test_expect_success 'auto squash that matches a commit after the squash' '\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD~4 &&\n \tgit log --oneline >actual &&\n-\ttest 5 = $(wc -l <actual) &&\n+\ttest_line_count = 5 actual &&\n \tgit diff --exit-code final-presquash &&\n \ttest 0 = \"$(git cat-file blob HEAD^^:file1)\" &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n@@ -147,7 +147,7 @@ test_expect_success 'auto squash that matches a sha1' '\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest 3 = $(wc -l <actual) &&\n+\ttest_line_count = 3 actual &&\n \tgit diff --exit-code final-shasquash &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n@@ -163,7 +163,7 @@ test_expect_success 'auto squash that matches longer sha1' '\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest 3 = $(wc -l <actual) &&\n+\ttest_line_count = 3 actual &&\n \tgit diff --exit-code final-longshasquash &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)\n@@ -179,7 +179,7 @@ test_auto_commit_flags () {\n \ttest_tick &&\n \tgit rebase --autosquash -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest 3 = $(wc -l <actual) &&\n+\ttest_line_count = 3 actual &&\n \tgit diff --exit-code final-commit-$1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest $2 = $(git cat-file commit HEAD^ | grep first | wc -l)\ndiff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh\nindex d48a7c0..37ddabb 100755\n--- a/t/t3900-i18n-commit.sh\n+++ b/t/t3900-i18n-commit.sh\n@@ -160,7 +160,7 @@ test_commit_autosquash_flags () {\n \t\tgit config --unset-all i18n.commitencoding &&\n \t\tgit rebase --autosquash -i HEAD^^^ &&\n \t\tgit log --oneline >actual &&\n-\t\ttest 3 = $(wc -l <actual)\n+\t\ttest_line_count = 3 actual\n \t'\n }\n \ndiff --git a/t/t4035-diff-quiet.sh b/t/t4035-diff-quiet.sh\nindex e747e84..cdb9202 100755\n--- a/t/t4035-diff-quiet.sh\n+++ b/t/t4035-diff-quiet.sh\n@@ -15,65 +15,65 @@ test_expect_success 'setup' '\n \n test_expect_success 'git diff-tree HEAD^ HEAD' '\n \tgit diff-tree --quiet HEAD^ HEAD >cnt\n-\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\ttest $? = 1 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-tree HEAD^ HEAD -- a' '\n \tgit diff-tree --quiet HEAD^ HEAD -- a >cnt\n-\ttest $? = 0 && test $(wc -l <cnt) = 0\n+\ttest $? = 0 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-tree HEAD^ HEAD -- b' '\n \tgit diff-tree --quiet HEAD^ HEAD -- b >cnt\n-\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\ttest $? = 1 && test_line_count = 0 cnt\n '\n # this diff outputs one line: sha1 of the given head\n test_expect_success 'echo HEAD | git diff-tree --stdin' '\n \techo $(git rev-parse HEAD) | git diff-tree --quiet --stdin >cnt\n-\ttest $? = 1 && test $(wc -l <cnt) = 1\n+\ttest $? = 1 && test_line_count = 1 cnt\n '\n test_expect_success 'git diff-tree HEAD HEAD' '\n \tgit diff-tree --quiet HEAD HEAD >cnt\n-\ttest $? = 0 && test $(wc -l <cnt) = 0\n+\ttest $? = 0 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-files' '\n \tgit diff-files --quiet >cnt\n-\ttest $? = 0 && test $(wc -l <cnt) = 0\n+\ttest $? = 0 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-index --cached HEAD' '\n \tgit diff-index --quiet --cached HEAD >cnt\n-\ttest $? = 0 && test $(wc -l <cnt) = 0\n+\ttest $? = 0 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-index --cached HEAD^' '\n \tgit diff-index --quiet --cached HEAD^ >cnt\n-\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\ttest $? = 1 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-index --cached HEAD^' '\n \techo text >>b &&\n \techo 3 >c &&\n \tgit add . && {\n \t\tgit diff-index --quiet --cached HEAD^ >cnt\n-\t\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\t\ttest $? = 1 && test_line_count = 0 cnt\n \t}\n '\n test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '\n \tgit commit -m \"text in b\" && {\n \t\tgit diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt\n-\t\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\t\ttest $? = 1 && test_line_count = 0 cnt\n \t}\n '\n test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '\n \tgit diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt\n-\ttest $? = 0 && test $(wc -l <cnt) = 0\n+\ttest $? = 0 && test_line_count = 0 cnt\n '\n test_expect_success 'git diff-files' '\n \techo 3 >>c && {\n \t\tgit diff-files --quiet >cnt\n-\t\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\t\ttest $? = 1 && test_line_count = 0 cnt\n \t}\n '\n test_expect_success 'git diff-index --cached HEAD' '\n \tgit update-index c && {\n \t\tgit diff-index --quiet --cached HEAD >cnt\n-\t\ttest $? = 1 && test $(wc -l <cnt) = 0\n+\t\ttest $? = 1 && test_line_count = 0 cnt\n \t}\n '\n \ndiff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh\nindex ebc36c1..81904d9 100755\n--- a/t/t5100-mailinfo.sh\n+++ b/t/t5100-mailinfo.sh\n@@ -65,7 +65,7 @@ test_expect_success 'respect NULs' '\n \tgit mailsplit -d3 -o. \"$TEST_DIRECTORY\"/t5100/nul-plain &&\n \ttest_cmp \"$TEST_DIRECTORY\"/t5100/nul-plain 001 &&\n \t(cat 001 | git mailinfo msg patch) &&\n-\ttest 4 = $(wc -l < patch)\n+\ttest_line_count = 4 patch\n \n '\n \ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex bbc4691..c47d450 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -34,7 +34,7 @@ test_expect_success 'cloning with reference (-l -s)' \\\n cd \"$base_dir\"\n \n test_expect_success 'existence of info/alternates' \\\n-'test `wc -l <C/.git/objects/info/alternates` = 2'\n+'test_line_count = 2 C/.git/objects/info/alternates'\n \n cd \"$base_dir\"\n \n@@ -63,7 +63,7 @@ test_expect_success 'fetched no objects' \\\n cd \"$base_dir\"\n \n test_expect_success 'existence of info/alternates' \\\n-'test `wc -l <D/.git/objects/info/alternates` = 1'\n+'test_line_count = 1 D/.git/objects/info/alternates'\n \n cd \"$base_dir\"\n \ndiff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh\nindex ef7127c..aa04529 100755\n--- a/t/t5710-info-alternate.sh\n+++ b/t/t5710-info-alternate.sh\n@@ -18,7 +18,7 @@ reachable_via() {\n \n test_valid_repo() {\n \tgit fsck --full > fsck.log &&\n-\ttest `wc -l < fsck.log` = 0\n+\ttest_line_count = 0 fsck.log\n }\n \n base_dir=`pwd`\ndiff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh\nindex 4442790..a01d244 100755\n--- a/t/t6006-rev-list-format.sh\n+++ b/t/t6006-rev-list-format.sh\n@@ -188,23 +188,23 @@ test_expect_success 'empty email' '\n \n test_expect_success 'del LF before empty (1)' '\n \tgit show -s --pretty=format:\"%s%n%-b%nThanks%n\" HEAD^^ >actual &&\n-\ttest $(wc -l <actual) = 2\n+\ttest_line_count = 2 actual\n '\n \n test_expect_success 'del LF before empty (2)' '\n \tgit show -s --pretty=format:\"%s%n%-b%nThanks%n\" HEAD >actual &&\n-\ttest $(wc -l <actual) = 6 &&\n+\ttest_line_count = 6 actual &&\n \tgrep \"^$\" actual\n '\n \n test_expect_success 'add LF before non-empty (1)' '\n \tgit show -s --pretty=format:\"%s%+b%nThanks%n\" HEAD^^ >actual &&\n-\ttest $(wc -l <actual) = 2\n+\ttest_line_count = 2 actual\n '\n \n test_expect_success 'add LF before non-empty (2)' '\n \tgit show -s --pretty=format:\"%s%+b%nThanks%n\" HEAD >actual &&\n-\ttest $(wc -l <actual) = 6 &&\n+\ttest_line_count = 6 actual &&\n \tgrep \"^$\" actual\n '\n \n@@ -278,8 +278,9 @@ test_expect_success 'oneline with empty message' '\n \tgit commit -m \"dummy\" --allow-empty &&\n \tgit filter-branch --msg-filter \"sed -e s/dummy//\" HEAD^^.. &&\n \tgit rev-list --oneline HEAD >test.txt &&\n-\ttest $(git rev-list --oneline HEAD | wc -l) -eq 5 &&\n-\ttest $(git rev-list --oneline --graph HEAD | wc -l) -eq 5\n+\ttest_line_count = 5 test.txt &&\n+\tgit rev-list --oneline --graph HEAD >testg.txt &&\n+\ttest_line_count = 5 testg.txt\n '\n \n test_done\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 691e4a4..72e28ee 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -480,7 +480,7 @@ test_expect_success 'many merge bases creation' '\n \tgit merge -m \"merge HASH7 and SIDE_HASH7\" \"$HASH7\" &&\n \tB_HASH=$(git rev-parse --verify HEAD) &&\n \tgit merge-base --all \"$A_HASH\" \"$B_HASH\" > merge_bases.txt &&\n-\ttest $(wc -l < merge_bases.txt) = \"2\" &&\n+\ttest_line_count = 2 merge_bases.txt &&\n \tgrep \"$HASH5\" merge_bases.txt &&\n \tgrep \"$SIDE_HASH5\" merge_bases.txt\n '\ndiff --git a/t/t6032-merge-large-rename.sh b/t/t6032-merge-large-rename.sh\nindex 94f010b..15beecc 100755\n--- a/t/t6032-merge-large-rename.sh\n+++ b/t/t6032-merge-large-rename.sh\n@@ -97,7 +97,7 @@ test_expect_success 'setup large simple rename' '\n test_expect_success 'massive simple rename does not spam added files' '\n \tsane_unset GIT_MERGE_VERBOSITY &&\n \tgit merge --no-stat simple-rename | grep -v Removing >output &&\n-\ttest 5 -gt \"$(wc -l < output)\"\n+\ttest_line_count -lt 5 output\n '\n \n test_done\ndiff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh\nindex 32591f9..b8d15fc 100755\n--- a/t/t6042-merge-rename-corner-cases.sh\n+++ b/t/t6042-merge-rename-corner-cases.sh\n@@ -104,7 +104,7 @@ test_expect_failure 'conflict caused if rename not detected' '\n \ttest 0 -eq $(git ls-files -u | wc -l) &&\n \ttest 0 -eq $(git ls-files -o | wc -l) &&\n \n-\ttest 6 -eq $(wc -l < c) &&\n+\ttest_line_count = 6 c\n \ttest $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&\n \ttest $(git rev-parse HEAD:b) = $(git rev-parse A:b)\n '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 07fb53a..be9672e 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -229,7 +229,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '\n \tgit checkout -f renamer && git clean -f &&\n \tgit checkout renamer^ 2>messages &&\n \ttest_i18ngrep \"HEAD is now at 7329388\" messages &&\n-\ttest 1 -eq $(wc -l <messages) &&\n+\ttest_line_count = 1 messages &&\n \tH=$(git rev-parse --verify HEAD) &&\n \tM=$(git show-ref -s --verify refs/heads/master) &&\n \ttest \"z$H\" = \"z$M\" &&\n@@ -247,7 +247,7 @@ test_expect_success 'checkout to detach HEAD' '\n \tgit checkout -f renamer && git clean -f &&\n \tgit checkout renamer^ 2>messages &&\n \ttest_i18ngrep \"HEAD is now at 7329388\" messages &&\n-\ttest 1 -lt $(wc -l <messages) &&\n+\ttest_line_count -gt 1 messages &&\n \tH=$(git rev-parse --verify HEAD) &&\n \tM=$(git show-ref -s --verify refs/heads/master) &&\n \ttest \"z$H\" = \"z$M\" &&\ndiff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh\nindex b377a7a..81827e6 100755\n--- a/t/t7400-submodule-basic.sh\n+++ b/t/t7400-submodule-basic.sh\n@@ -234,7 +234,7 @@ EOF\n \n test_expect_success 'status should only print one line' '\n \tgit submodule status >lines &&\n-\ttest $(wc -l <lines) = 1\n+\ttest_line_count = 1 lines\n '\n \n test_expect_success 'setup - fetch commit name from submodule' '\ndiff --git a/t/t7408-submodule-reference.sh b/t/t7408-submodule-reference.sh\nindex ab37c36..a45fadc 100755\n--- a/t/t7408-submodule-reference.sh\n+++ b/t/t7408-submodule-reference.sh\n@@ -43,7 +43,7 @@ git commit -m B-super-added'\n cd \"$base_dir\"\n \n test_expect_success 'after add: existence of info/alternates' \\\n-'test `wc -l <super/.git/modules/sub/objects/info/alternates` = 1'\n+'test_line_count = 1 super/.git/modules/sub/objects/info/alternates'\n \n cd \"$base_dir\"\n \n@@ -66,7 +66,7 @@ test_expect_success 'update with reference' \\\n cd \"$base_dir\"\n \n test_expect_success 'after update: existence of info/alternates' \\\n-'test `wc -l <super-clone/.git/modules/sub/objects/info/alternates` = 1'\n+'test_line_count = 1 super-clone/.git/modules/sub/objects/info/alternates'\n \n cd \"$base_dir\"\n \ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 3f3adc3..181456a 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -335,7 +335,7 @@ test_expect_success 'A single-liner subject with a token plus colon is not a foo\n \tgit reset --hard &&\n \tgit commit -s -m \"hello: kitty\" --allow-empty &&\n \tgit cat-file commit HEAD | sed -e \"1,/^$/d\" >actual &&\n-\ttest $(wc -l <actual) = 3\n+\ttest_line_count = 3 actual\n \n '\n \ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 950d0ff..b00196b 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -86,7 +86,7 @@ test_expect_success 'import/export-marks' '\n \tgit checkout -b marks master &&\n \tgit fast-export --export-marks=tmp-marks HEAD &&\n \ttest -s tmp-marks &&\n-\ttest $(wc -l < tmp-marks) -eq 3 &&\n+\ttest_line_count = 3 tmp-marks &&\n \ttest $(\n \t\tgit fast-export --import-marks=tmp-marks\\\n \t\t--export-marks=tmp-marks HEAD |\n@@ -101,7 +101,7 @@ test_expect_success 'import/export-marks' '\n \t\tgrep ^commit\\  |\n \t\twc -l) \\\n \t-eq 1 &&\n-\ttest $(wc -l < tmp-marks) -eq 4\n+\ttest_line_count = 4 tmp-marks\n \n '\n \ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 9199550..d3e88f8 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -476,14 +476,14 @@ test_expect_success 'cvs status' '\n     cd cvswork &&\n     GIT_CONFIG=\"$git_config\" cvs update &&\n     GIT_CONFIG=\"$git_config\" cvs status | grep \"^File: status.file\" >../out &&\n-    test $(wc -l <../out) = 2\n+    test_line_count = 2 ../out\n '\n \n cd \"$WORKDIR\"\n test_expect_success 'cvs status (nonrecursive)' '\n     cd cvswork &&\n     GIT_CONFIG=\"$git_config\" cvs status -l | grep \"^File: status.file\" >../out &&\n-    test $(wc -l <../out) = 1\n+    test_line_count = 1 ../out\n '\n \n cd \"$WORKDIR\"\n-- \n1.7.9\n"},{"id":"188995","messageId":"7vy5q2ky7d.fsf@alter.siamese.dyndns.org","threadId":"30206","inReplyTo":"e701486509c3306420e6bcf82e7d0d79fb2e7ae1.1334143281.git.stefano.lattarini@gmail.com","subject":"Re: [PATCH] tests: modernise style: more uses of test_line_count","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-11T16:52:38Z","receivedAt":"2012-04-11T16:52:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I'll squash this in, but otherwise it looks good.  There is nothing\nconflicting in flight right now.\n\nThanks.\n\n t/t3415-rebase-autosquash.sh         |    4 ++--\n t/t6042-merge-rename-corner-cases.sh |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex 5fc366a..a1e86c4 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -33,7 +33,7 @@ test_auto_fixup () {\n \ttest_tick &&\n \tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest_line_count = 3 actual\n+\ttest_line_count = 3 actual &&\n \tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep first | wc -l)\n@@ -62,7 +62,7 @@ test_auto_squash () {\n \ttest_tick &&\n \tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n-\ttest_line_count = 3 actual\n+\ttest_line_count = 3 actual &&\n \tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^ | grep first | wc -l)\ndiff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh\nindex b8d15fc..466fa38 100755\n--- a/t/t6042-merge-rename-corner-cases.sh\n+++ b/t/t6042-merge-rename-corner-cases.sh\n@@ -104,7 +104,7 @@ test_expect_failure 'conflict caused if rename not detected' '\n \ttest 0 -eq $(git ls-files -u | wc -l) &&\n \ttest 0 -eq $(git ls-files -o | wc -l) &&\n \n-\ttest_line_count = 6 c\n+\ttest_line_count = 6 c &&\n \ttest $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&\n \ttest $(git rev-parse HEAD:b) = $(git rev-parse A:b)\n '\n"},{"id":"188996","messageId":"7vty0qkxc2.fsf@alter.siamese.dyndns.org","threadId":"30206","inReplyTo":"7vy5q2ky7d.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] tests: modernise style: more uses of test_line_count","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-11T17:11:25Z","receivedAt":"2012-04-11T17:11:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I'll squash this in, but otherwise it looks good.  There is nothing\n> conflicting in flight right now.\n\nIn case somebody is curious, I've eyeballed the result of applying this\npatch to v1.7.10 and the result of running the following on v1.7.10 to\nfind these three.  The other differences looked fine; we lost a few\nvariables like $loglen but they are not otherwise used, which was harder\nto see without enough context.\n\n-- >8 --\n#!/bin/sh\n\nperl -i -p -e '\n\ts/test\\s+\\$\\(wc\\s+-l\\s+<\\s*([.\\/a-zA-Z0-9_]+)\\)\\s+(?:=|-eq)\\s+\"?(\\d+)\"?\n\t    /test_line_count = $2 $1/x;\n\ts/test\\s+\"?(\\d+)\"?\\s+(?:=|-eq)\\s+\\$\\(wc\\s+-l\\s+<\\s*([.\\/a-zA-Z0-9_]+)\\)\n\t    /test_line_count = $1 $2/x;\n\ts/test\\s+\\`wc\\s+-l\\s+<\\s*([.\\/a-zA-Z0-9_]+)\\`\\s+(?:=|-eq)\\s+\"?(\\d+)\"?\n\t    /test_line_count = $2 $1/x;\n\ts/test\\s+\"?(\\d+)\"?\\s+(?:=|-eq)\\s+\\`wc\\s+-l\\s+<\\s*([.\\/a-zA-Z0-9_]+)\\`\n\t    /test_line_count = $1 $2/x;\n' t/t[0-9][0-9][0-9][0-9]-*.sh\n"},{"id":"189002","messageId":"4F85C0F2.4060500@gmail.com","threadId":"30206","inReplyTo":"7vy5q2ky7d.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] tests: modernise style: more uses of test_line_count","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2012-04-11T17:35:46Z","receivedAt":"2012-04-11T17:35:46Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 04/11/2012 06:52 PM, Junio C Hamano wrote:\n> I'll squash this in, but otherwise it looks good.  There is nothing\n> conflicting in flight right now.\n> \nThanks for taking care of that, and sorry for the sloppiness.\n\nRegards,\n  Stefano\n"}]}