t7811 (grep-open): remove test_config() redefinition
PATCH 1/1 t7811 (grep-open): remove test_config() redefinition
test_config() is already a well-defined function in test-lib-functions.sh. Don't duplicate it unnecessarily.
---
Found this while randomly grep'ping around.
t/t7811-grep-open.sh | 5 ----- 1 file changed, 5 deletions(-)
t/t7811-grep-open.sh +0 -5
@@ -125,11 +125,6 @@ test_expect_success 'modified file' ' test_cmp empty out ' -test_config() { - git config "$1" "$2" && - test_when_finished "git config --unset $1" -} - test_expect_success 'copes with color settings' ' rm -f actual && echo grep.h >expect &&
Signature · 1 line
1.8.2
Quoted 2 lines · Ramkumar Ramachandra
test_config()is already a well-defined function intest-lib-functions.sh. Don't duplicate it unnecessarily.
There are other instances of it in t7810 and t4018, with slightly different styles.
t/t4018-diff-funcname.sh:test_config () {
t/t7810-grep.sh:test_config() {
t/t7811-grep-open.sh:test_config() {
t/test-lib-functions.sh:test_config () {
Incidentally, this is why a consistent coding style helps. It should be possible to catch all ofhtme with a single
git grep 'test_config () {' t/
but the ones in t78xx wouldn't have been found.
Quoted 23 lines
Signed-off-by Ramkumar Ramachandra <[email protected]>---
Found this while randomly grep'ping around.t/t7811-grep-open.sh | 5 ----- 1 file changed, 5 deletions(-)t/t7811-grep-open.sh +0
-5@@ -125,11 +125,6 @@ test_expect_success 'modified file' ' test_cmp empty out ' -test_config() { - git config "$1" "$2" && - test_when_finished "git config --unset $1" -} - test_expect_success 'copes with color settings' ' rm -f actual && echo grep.h >expect &&
PATCH 1/1 t: don't redefine test_config() in various places
test_config() is already a well-defined function in test-lib-functions.sh. Don't duplicate it unnecessarily in:
t4018-diff-funcname.sh
t7810-grep.sh
t7811-grep-open.sh
---
Thanks, Junio.
t/t4018-diff-funcname.sh | 5 ----- t/t7810-grep.sh | 5 ----- t/t7811-grep-open.sh | 5 ----- 3 files changed, 15 deletions(-)
t/t4018-diff-funcname.sh +0 -5
@@ -93,11 +93,6 @@ sed -e ' s/song;/song();/ ' <Beer.perl >Beer-correct.perl -test_config () { - git config "$1" "$2" && - test_when_finished "git config --unset $1" -} - test_expect_funcname () { lang=${2-java} test_expect_code 1 git diff --no-index -U1 \
t/t7810-grep.sh +0 -5
@@ -1084,11 +1084,6 @@ test_expect_success 'grep -E pattern with grep.patternType=fixed' ' test_cmp expected actual ' -test_config() { - git config "$1" "$2" && - test_when_finished "git config --unset $1" -} - cat >expected <<EOF hello.c<RED>:<RESET>int main(int argc, const char **argv) hello.c<RED>-<RESET>{
t/t7811-grep-open.sh +0 -5
@@ -125,11 +125,6 @@ test_expect_success 'modified file' ' test_cmp empty out ' -test_config() { - git config "$1" "$2" && - test_when_finished "git config --unset $1" -} - test_expect_success 'copes with color settings' ' rm -f actual && echo grep.h >expect &&
Signature · 1 line
1.8.2
Re: [PATCH] t: don't redefine test_config() in various places
Quoted 8 lines · Ramkumar Ramachandra
Signed-off-by Ramkumar Ramachandra <[email protected]>---
Thanks, Junio.t/t4018-diff-funcname.sh | 5 ----- t/t7810-grep.sh | 5 ----- t/t7811-grep-open.sh | 5 ----- 3 files changed, 15 deletions(-)
Yeah, that looks like all of them. FWIW,
Re: [PATCH] t: don't redefine test_config() in various places
In reply to Ramkumar RamachandraQuoted 10 lines · Ramkumar Ramachandra
test_config()is already a well-defined function intest-lib-functions.sh. Don't duplicate it unnecessarily in:
t4018-diff-funcname.sh
t7810-grep.sh
t7811-grep-open.shSigned-off-by Ramkumar Ramachandra <[email protected]>---
Thanks, Junio.
Heh, I've pushed out the original one after fixing them up myself last night.
Re: [PATCH] t: don't redefine test_config() in various places
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Ramkumar Ramachandra
test_config()is already a well-defined function intest-lib-functions.sh. Don't duplicate it unnecessarily in:
t4018-diff-funcname.sh
t7810-grep.sh
t7811-grep-open.sh
Quoted 6 lines
Quoted 3 lines
Signed-off-by Ramkumar Ramachandra <[email protected]>---
Thanks, Junio.Heh, I've pushed out the original one after fixing them up myself last night.
Doing a fine job as the editor, as always. I need to watch pu more closely.