From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id C9552209F1 for ; Thu, 6 Apr 2017 08:22:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752465AbdDFIWD (ORCPT ); Thu, 6 Apr 2017 04:22:03 -0400 Received: from mout.gmx.net ([212.227.17.20]:65299 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751713AbdDFIWA (ORCPT ); Thu, 6 Apr 2017 04:22:00 -0400 Received: from virtualbox ([37.201.193.73]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MQih7-1cWMYb2Yaz-00TzVp; Thu, 06 Apr 2017 10:21:40 +0200 Date: Thu, 6 Apr 2017 10:21:38 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: =?UTF-8?Q?SZEDER_G=C3=A1bor?= cc: git@jeffhostetler.com, gitster@pobox.com, peff@peff.net, Jeff Hostetler , git@vger.kernel.org Subject: Re: [PATCH v5 3/4] test-strcmp-offset: created test for strcmp_offset In-Reply-To: <20170405224752.2242-1-szeder.dev@gmail.com> Message-ID: References: <20170405224752.2242-1-szeder.dev@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-745214947-1491466900=:4268" X-Provags-ID: V03:K0:sf6Tg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VeY1Eq+ k1BTBnU Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-745214947-1491466900=:4268 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi G=C3=A1bor, On Thu, 6 Apr 2017, SZEDER G=C3=A1bor wrote: > I think this patch should be squashed into the previous commit; I > don't see any reason why the tests should be added in a different > commit than the function they are testing. I am of two minds there. In some cases, the newly added test demonstrates the intended usage, and therefore makes for a nice documentation. In other cases, the new test is large enough to stand on its own, i.e. to merit a separate patch (also to make reviewing easier). In this particular case, I tend to the latter: it is large enough a patch that it is easier to review as a separate patch. > > t/helper/test-strcmp-offset.c | 64 +++++++++++++++++++++++++++++++++++= ++++++++ > > t/t0065-strcmp-offset.sh | 11 ++++++++ > > 4 files changed, 77 insertions(+) > > create mode 100644 t/helper/test-strcmp-offset.c > > create mode 100755 t/t0065-strcmp-offset.sh >=20 > Sure, tests are good, but I have to wonder how this would scale in the > long term, when even such simple functions would get their own > t/helper/test-func executable and t/tNNNN-func.sh script. True. The proliferation of executables in t/helper/ got a little out of hand. But there is nothing preventing us from consolidating a few of them into a single executable, using our wonderful option parsing function with OPT_CMDMODE to switch between the different functions. I could see, for example, how we could consolidate all string-related test helpers into a single one, say, test-strings: t/helper/test-ctype.c t/helper/test-regex.c t/helper/test-strcmp-offset.c t/helper/test-string-list.c t/helper/test-line-buffer.c t/helper/test-urlmatch-normalization.c t/helper/test-wildmatch.c Also, these helpers seem to be related to index handling and could go into a new test-index helper: t/helper/test-dump-cache-tree.c t/helper/test-dump-split-index.c t/helper/test-dump-untracked-cache.c t/helper/test-index-version.c t/helper/test-scrap-cache-tree.c Ciao, Johannes --8323329-745214947-1491466900=:4268--