Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-02-13 03:36:01 +0300
committerJunio C Hamano <gitster@pobox.com>2018-02-13 21:45:26 +0300
commit2708ef4af6ed60b89e93de72673e7b785b93d760 (patch)
tree82c01026ce0e911e7453446e0506ea70141fd239 /t/t6300-for-each-ref.sh
parent8279ed033f703d4115bee620dccd32a9ec94d9aa (diff)
t6300-for-each-ref: fix "more than one quoting style" tests
'git for-each-ref' should error out when invoked with more than one quoting style options. The tests checking this have two issues: - They run 'git for-each-ref' upstream of a pipe, hiding its exit code, thus don't actually checking that 'git for-each-ref' exits with error code. - They check the error message in a rather roundabout way. Ensure that 'git for-each-ref' exits with an error code using the 'test_must_fail' helper function, and check its error message by grepping its saved standard error. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-xt/t6300-for-each-ref.sh7
1 files changed, 2 insertions, 5 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index c128dfc579..295d1475bd 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -373,11 +373,8 @@ test_expect_success 'Quoting style: tcl' '
for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do
test_expect_success "more than one quoting style: $i" "
- git for-each-ref $i 2>&1 | (read line &&
- case \$line in
- \"error: more than one quoting style\"*) : happy;;
- *) false
- esac)
+ test_must_fail git for-each-ref $i 2>err &&
+ grep '^error: more than one quoting style' err
"
done