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>
SZEDER Gábor committed
Feb 3, 2017 at 03:48 UTC
8f0fa85d4d21b67f80d408dd75b35623d829511e
1 file changed
+5
-3
t/t9902-completion.sh
+5
-3
@@ -215,8 +215,9 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
215
(
216
GIT_DIR="$ROOT/non-existing" &&
217
export GIT_DIR &&
218
- test_must_fail __gitdir
219
- )
218
+ test_must_fail __gitdir >"$actual"
219
+ ) &&
220
+ test_must_be_empty "$actual"
221
'
222
223
test_expect_success '__gitdir - gitfile in cwd' '
@@ -255,7 +256,8 @@ test_expect_success SYMLINKS '__gitdir - resulting path avoids symlinks' '
256
'
257
258
test_expect_success '__gitdir - not a git repository' '
258
- nongit test_must_fail __gitdir
259
+ nongit test_must_fail __gitdir >"$actual" &&
260
+ test_must_be_empty "$actual"
261
'
262
263
test_expect_success '__gitcomp - trailing space - options' '