summaryrefslogtreecommitdiff
path: root/t/t9902-completion.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2017-02-03 02:48:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-04 06:18:40 (GMT)
commit8f0fa85d4d21b67f80d408dd75b35623d829511e (patch)
tree2a33105345ccf97332961fc2f85421b4ec442fcb /t/t9902-completion.sh
parentf6114408113af39a18b21693c3a83600e06e5475 (diff)
downloadgit-8f0fa85d4d21b67f80d408dd75b35623d829511e.zip
git-8f0fa85d4d21b67f80d408dd75b35623d829511e.tar.gz
git-8f0fa85d4d21b67f80d408dd75b35623d829511e.tar.bz2
completion tests: check __gitdir()'s output in the error cases
The __gitdir() helper function shouldn't output anything if not in a git repository. The relevant tests only checked its error code, so extend them to ensure that there's no output. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 030a16e..f7f7d49 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -215,8 +215,9 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
(
GIT_DIR="$ROOT/non-existing" &&
export GIT_DIR &&
- test_must_fail __gitdir
- )
+ test_must_fail __gitdir >"$actual"
+ ) &&
+ test_must_be_empty "$actual"
'
test_expect_success '__gitdir - gitfile in cwd' '
@@ -255,7 +256,8 @@ test_expect_success SYMLINKS '__gitdir - resulting path avoids symlinks' '
'
test_expect_success '__gitdir - not a git repository' '
- nongit test_must_fail __gitdir
+ nongit test_must_fail __gitdir >"$actual" &&
+ test_must_be_empty "$actual"
'
test_expect_success '__gitcomp - trailing space - options' '