From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 257851F55B for ; Tue, 2 Jun 2020 18:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbgFBSEM (ORCPT ); Tue, 2 Jun 2020 14:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbgFBSEL (ORCPT ); Tue, 2 Jun 2020 14:04:11 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B3DC05BD1E for ; Tue, 2 Jun 2020 11:04:11 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id r15so4052298wmh.5 for ; Tue, 02 Jun 2020 11:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lTOPGe816G7kk2+DzFlyI2n2KXAoFVxArvI+BDcJrRY=; b=MpV3JsM2ROWK0d7t3cRXZZhpoKnw3Aq9LQv0yYvNQxg0rYG0yGenLc+57/A5hAU6FZ bi1eUwoYp6Chv8k35wd/27Emu6jY5qNeZMMPBUJbH5J/bJkZdIjH32/wJ0Lgozv++Luv JlwiMtNxiZV6pU5k5j4Ap7B4fauDOS00SD2vwAI0t8cFamcppWN4kFSLV6/4MxOEJJYE WIFiqKtrGVe0CcZeaBktXJsSz7Qqj1M5Y4UHLFdFjqFRzdtVA8KOep1iIV5zrzVop51d 8yDT1SPC6yV2/qPdPvNUmeeoBBqL7dnOPiJw2sTrfkROiQGHHkv8iz4UB6DSoHo3mHKG JLKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lTOPGe816G7kk2+DzFlyI2n2KXAoFVxArvI+BDcJrRY=; b=dmwIO//Czio2EZ+Dbncd79sFdI3P9G9PcV1iMpEqv16CsJXiTMZ8TE+zLvIGcTKt7N EfpzzfY3r/avFPZurie7b6BhDol8YmC8xARbZI+RHaJ1+3N//rQ9/7wNPdsDUr0O2DIx bLfrO9LCGBJ+802EFZ/2qlm/PPlmo8NBXxMAmT/bOuiIno9QWRTYeltd2jcdCj3akobf TGJKNLzPbYSeCKj/k6evCl7Sgz7zZepsxePDskyz2S7fZdDN5sqwbqDDMVkl/CfNfMpF tJQUvcChlX6N/znvvOSv+Vy1p5zOF45kDKraAmJANqJiHY6/FDGG/dJkCJ+kOTfHtwz/ Zxqw== X-Gm-Message-State: AOAM530D1zd2PgHzbVd+hzMJKLVGWs6l0bkKaXTQ/dPNGvIcRmjnQ4wI BsowQTXpyKFdmxX482IunOA= X-Google-Smtp-Source: ABdhPJxm3tcCNi9ZppxzbMMJHhhA3Lc/ygkSLpPouOF7utAer9qYIQIg+/blkmIO2xSzYz89q97VqA== X-Received: by 2002:a1c:f312:: with SMTP id q18mr3515540wmq.106.1591121050065; Tue, 02 Jun 2020 11:04:10 -0700 (PDT) Received: from szeder.dev (78-131-14-185.pool.digikabel.hu. [78.131.14.185]) by smtp.gmail.com with ESMTPSA id k14sm4757232wrq.97.2020.06.02.11.04.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jun 2020 11:04:09 -0700 (PDT) Date: Tue, 2 Jun 2020 20:04:03 +0200 From: SZEDER =?utf-8?B?R8OhYm9y?= To: Taylor Blau Cc: git@vger.kernel.org, dstolee@microsoft.com Subject: Re: [PATCH 1/2] t5318: use 'test_must_be_empty' Message-ID: <20200602180403.GA4791@szeder.dev> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Jun 01, 2020 at 12:01:27PM -0600, Taylor Blau wrote: > A handful of tests in t5318 use 'test_line_count = 0 ...' to make sure > that some command does not write any output. While correct, it is more > helpful to use 'test_must_be_empty' instead, since the latter prints the > contents of the file if it is non-empty. > > Since 'test_line_count' only prints the expected and actual line count, > not the contents, using 'test_must_be_empty' may be more helpful for > debugging if there is regression in any of these tests. These two paragraphs essentially say the same thing, so I think only one would be sufficient, but... Both paragraphs are wrong, because 'test_line_count' does include the content of the file on failure: expecting success of 9999.1 'test': cat >foo <<-EOF && Add some content EOF test_line_count = 0 foo test_line_count: line count for foo != 0 Add some content not ok 1 - test Having said that, I think that the change itself is good, because 'test_must_be_empty foo' is more idiomatic.