summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-06 23:09:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-06 23:09:22 (GMT)
commit4ba74ca901407a64186c40ed9e59bbd9b2277993 (patch)
tree3535378b099e5b9082ab8950ebef838fc853901e /t
parentf233c9f4550a831a69892e0a38db2a7654beb995 (diff)
parent271c351b2f0cd252d84fbe30d9a03e6f7b930e9b (diff)
downloadgit-4ba74ca901407a64186c40ed9e59bbd9b2277993.zip
git-4ba74ca901407a64186c40ed9e59bbd9b2277993.tar.gz
git-4ba74ca901407a64186c40ed9e59bbd9b2277993.tar.bz2
Merge branch 'rs/test-cleanup'
Test cleanup. * rs/test-cleanup: t7811: don't create unused file t9300: don't create unused file test: use test_must_be_empty F instead of test_cmp empty F test: use test_must_be_empty F instead of test -z $(cat F) t1400: use test_must_be_empty t1410: use test_line_count t1512: use test_line_count
Diffstat (limited to 't')
-rwxr-xr-xt/t1011-read-tree-sparse-checkout.sh3
-rwxr-xr-xt/t1309-early-config.sh2
-rwxr-xr-xt/t1400-update-ref.sh8
-rwxr-xr-xt/t1410-reflog.sh4
-rwxr-xr-xt/t1506-rev-parse-diagnosis.sh8
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh2
-rwxr-xr-xt/t6019-rev-list-ancestry-path.sh4
-rwxr-xr-xt/t7811-grep-open.sh1
-rwxr-xr-xt/t9010-svn-fe.sh4
-rwxr-xr-xt/t9300-fast-import.sh3
10 files changed, 16 insertions, 23 deletions
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index ba71b15..eb44baf 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -215,7 +215,6 @@ test_expect_success 'read-tree adds to worktree, dirty case' '
'
test_expect_success 'index removal and worktree narrowing at the same time' '
- >empty &&
echo init.t >.git/info/sparse-checkout &&
echo sub/added >>.git/info/sparse-checkout &&
git checkout -f top &&
@@ -223,7 +222,7 @@ test_expect_success 'index removal and worktree narrowing at the same time' '
git checkout removed &&
git ls-files sub/added >result &&
test ! -f sub/added &&
- test_cmp empty result
+ test_must_be_empty result
'
test_expect_success 'read-tree --reset removes outside worktree' '
diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh
index 3a0de0d..ebb8e1a 100755
--- a/t/t1309-early-config.sh
+++ b/t/t1309-early-config.sh
@@ -29,7 +29,7 @@ test_expect_success 'ceiling' '
cd sub &&
test-tool config read_early_config early.config
) >output &&
- test -z "$(cat output)"
+ test_must_be_empty output
'
test_expect_success 'ceiling #2' '
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 69a7f27..b815cdd 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -380,13 +380,13 @@ test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history star
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e &&
test $C = $(cat o) &&
- test "" = "$(cat e)"
+ test_must_be_empty e
'
test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' '
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e &&
test $A = $(cat o) &&
- test "" = "$(cat e)"
+ test_must_be_empty e
'
test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' '
test_when_finished "rm -f o e" &&
@@ -398,13 +398,13 @@ test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' '
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e &&
test $Z = $(cat o) &&
- test "" = "$(cat e)"
+ test_must_be_empty e
'
test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' '
test_when_finished "rm -f o e" &&
git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e &&
test $E = $(cat o) &&
- test "" = "$(cat e)"
+ test_must_be_empty e
'
test_expect_success 'Query "master@{2005-05-28}" (past end of history)' '
test_when_finished "rm -f o e" &&
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 82950c0..76d9b74 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -195,7 +195,7 @@ test_expect_success 'delete' '
git reflog delete master@{1} &&
git reflog show master > output &&
- test $(($master_entry_count - 1)) = $(wc -l < output) &&
+ test_line_count = $(($master_entry_count - 1)) output &&
test $HEAD_entry_count = $(git reflog | wc -l) &&
! grep ox < output &&
@@ -209,7 +209,7 @@ test_expect_success 'delete' '
git reflog delete master@{07.04.2005.15:15:00.-0700} &&
git reflog show master > output &&
- test $(($master_entry_count - 1)) = $(wc -l < output) &&
+ test_line_count = $(($master_entry_count - 1)) output &&
! grep dragon < output
'
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 624d0a5..6d951ca 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -138,10 +138,10 @@ test_expect_success 'incorrect file in :path and :N:path' '
test_expect_success 'invalid @{n} reference' '
test_must_fail git rev-parse master@{99999} >output 2>error &&
- test -z "$(cat output)" &&
+ test_must_be_empty output &&
grep "fatal: Log for [^ ]* only has [0-9][0-9]* entries." error &&
test_must_fail git rev-parse --verify master@{99999} >output 2>error &&
- test -z "$(cat output)" &&
+ test_must_be_empty output &&
grep "fatal: Log for [^ ]* only has [0-9][0-9]* entries." error
'
@@ -155,13 +155,13 @@ test_expect_success 'relative path not found' '
test_expect_success 'relative path outside worktree' '
test_must_fail git rev-parse HEAD:../file.txt >output 2>error &&
- test -z "$(cat output)" &&
+ test_must_be_empty output &&
test_i18ngrep "outside repository" error
'
test_expect_success 'relative path when cwd is outside worktree' '
test_must_fail git --git-dir=.git --work-tree=subdir rev-parse HEAD:./file.txt >output 2>error &&
- test -z "$(cat output)" &&
+ test_must_be_empty output &&
grep "relative path syntax can.t be used outside working tree." error
'
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 25744e2..18fa6cf 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -282,7 +282,7 @@ test_expect_success 'rev-parse --disambiguate' '
# commits created by commit-tree in earlier tests share a
# different prefix.
git rev-parse --disambiguate=000000000 >actual &&
- test $(wc -l <actual) = 16 &&
+ test_line_count = 16 actual &&
test "$(sed -e "s/^\(.........\).*/\1/" actual | sort -u)" = 000000000
'
diff --git a/t/t6019-rev-list-ancestry-path.sh b/t/t6019-rev-list-ancestry-path.sh
index beadaf6..353f843 100755
--- a/t/t6019-rev-list-ancestry-path.sh
+++ b/t/t6019-rev-list-ancestry-path.sh
@@ -143,14 +143,14 @@ test_expect_success 'setup criss-cross' '
test_expect_success 'criss-cross: rev-list --ancestry-path cb..bc' '
(cd criss-cross &&
git rev-list --ancestry-path xcb..xbc > actual &&
- test -z "$(cat actual)")
+ test_must_be_empty actual)
'
# no commits in repository descend from cb
test_expect_success 'criss-cross: rev-list --ancestry-path --all ^cb' '
(cd criss-cross &&
git rev-list --ancestry-path --all ^xcb > actual &&
- test -z "$(cat actual)")
+ test_must_be_empty actual)
'
test_done
diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh
index d1ebfd8..a98785d 100755
--- a/t/t7811-grep-open.sh
+++ b/t/t7811-grep-open.sh
@@ -113,7 +113,6 @@ test_expect_success 'modified file' '
subdir/grep.c
unrelated
EOF
- >empty &&
echo "enum grep_pat_token" >unrelated &&
test_when_finished "git checkout HEAD unrelated" &&
diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
index 0b20b07..c90fdc5 100755
--- a/t/t9010-svn-fe.sh
+++ b/t/t9010-svn-fe.sh
@@ -53,8 +53,6 @@ text_no_props () {
printf "%s\n" "$text"
}
->empty
-
test_expect_success 'empty dump' '
reinit_git &&
echo "SVN-fs-dump-format-version: 2" >input &&
@@ -208,7 +206,7 @@ test_expect_failure 'timestamp and empty file' '
test_cmp expect.date actual.date &&
test_cmp expect.files actual.files &&
git checkout HEAD empty-file &&
- test_cmp empty file
+ test_must_be_empty file
'
test_expect_success 'directory with files' '
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index e707fb8..062d599 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2477,9 +2477,6 @@ test_expect_success PIPE 'R: copy using cat-file' '
echo $expect_id blob $expect_len >expect.response &&
rm -f blobs &&
- cat >frontend <<-\FRONTEND_END &&
- #!/bin/sh
- FRONTEND_END
mkfifo blobs &&
(