Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 5/6] completion: refactor __gitcomp related tests

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:18

SZEDER Gábor [off-list ref] writes:
On Sun, Nov 11, 2012 at 03:35:57PM +0100, Felipe Contreras wrote:
quoted
Lots of duplicated code!

No functional changes.

Signed-off-by: Felipe Contreras <redacted>
---
 t/t9902-completion.sh | 76 ++++++++++++++++++---------------------------------
 1 file changed, 27 insertions(+), 49 deletions(-)
Despite the impressive numbers, these tests are more useful without
this cleanup.
Is this because consolidation of the duplicated part of the tests
into a single helper makes it harder to instrument one test you are
interested in (or developing) for debugging?

It indeed is a problem, and cutting and pasting the same code to
multiple tests is one way to solve the problem (you can easily
instrument the copy in the test you are interested in while leaving
others intact), but I do not think that is a good solution.  A bugfix
or enhancement to the shared (or duplicated) part can be done by
touching one place only after this change, while with the current
code you have to repeat the same fix to all places, no?
quoted
+# Test __gitcomp.
+# Arguments are:
+# 1: typed text so far (cur)
The first argument is not the typed text so far, but the word
currently containing the cursor position.
Care to update this with a follow-up patch, so that I do not have to
keep track of minute details ;-)?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help