From patchwork Wed Nov 27 19:53:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 11264821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCA23138C for ; Wed, 27 Nov 2019 19:53:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC31420835 for ; Wed, 27 Nov 2019 19:53:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H9kXxbhe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727287AbfK0TxT (ORCPT ); Wed, 27 Nov 2019 14:53:19 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:38781 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbfK0TxT (ORCPT ); Wed, 27 Nov 2019 14:53:19 -0500 Received: by mail-pj1-f65.google.com with SMTP id f7so10551499pjw.5 for ; Wed, 27 Nov 2019 11:53:18 -0800 (PST) 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=Dxh2jaW1UxAziQYQjHScRCLmQiudoN4gja7P1jegEhY=; b=H9kXxbheIjylpxQKrx0g7wpmQ7z9gbWH95Lp7rIhNqBLmkOl+V6FeDj+YfVxZCxNZ5 KRYToU9RYE93ZPVy0fbjmOFv9OZbH2vhPL/uT0pcS5gsbGLFTxJXfifkM4m022Lufm1L 3GK99VZ3xsUpSfNxOwT3x/yK2lbkFRh38tF1D/s+OCwaiOyh3pyTWRuDaBnWbG2Ykltw aZStoqvmCx8G+Bfv5inCg6T3cBfOqgjjvBCEWAhF53ARPhaIfehONBwddh5nPGTK/2ci a32mjTNn3bt9eUs4V8+Ghnx3SVRoSi5xM3iN+qaLCrLkQVFfgHM5l7h02SjHqks84Ina Cemw== 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=Dxh2jaW1UxAziQYQjHScRCLmQiudoN4gja7P1jegEhY=; b=EmHw3Znl2kzTWnsxVXSrIf0VD0fMuVynh/VTinQIPlofxywBFV1tUgMDj3s2O4pMbm DdPFADc1FIE9rQCFAR2C3fFPJjLY1R3ox/A2jNUUmtFROSw1h2HuLlzCSVVw9raWyDjf eC2iXLsYMx41qdX1K06eMzkS4p4dUZ3ZH9DvlaE+mO+dKdq/ViJAG0HZHh0xMwaHG4iM gbdC7ubKItBQZNCk3AkUGP3s1Q4yRbnbMB6HfoGcPqrIDcz6ZYhVkpOqtvQjMFH649iT HXTZrtHEHj2X6/IxRBgxuErPIYhH7412R4jSo7AKOT0Z8gobPo6yls2ioMF69npts6qI jPNw== X-Gm-Message-State: APjAAAUYius9T4kWoGg+3OROOjrU/eCMoPvzG/nwvH4ANkoIh+qA7NlY jyoO8VL95BmDPgGpS39lHxqaYX52 X-Google-Smtp-Source: APXvYqxnHwFpulAWHpboIvraajbotzZTZKCECvvfKIFfJmMwYZezckfLitc4EaII7zMWfVx8wGlxvQ== X-Received: by 2002:a17:90a:34c7:: with SMTP id m7mr7966262pjf.103.1574884398042; Wed, 27 Nov 2019 11:53:18 -0800 (PST) Received: from generichostname ([204.14.239.138]) by smtp.gmail.com with ESMTPSA id x4sm7293833pgg.61.2019.11.27.11.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2019 11:53:17 -0800 (PST) Date: Wed, 27 Nov 2019 11:53:16 -0800 From: Denton Liu To: Git Mailing List Cc: Eric Sunshine , Junio C Hamano , Jeff King Subject: [PATCH v5 06/26] t3600: use test_line_count() where possible Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since we have a helper function that can test the number of lines in a file that gives better debugging information on failure, use test_line_count() to test the number of lines. Signed-off-by: Denton Liu --- t/t3600-rm.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 8c8cca5bfb..f6e659b7e9 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -113,9 +113,10 @@ test_expect_success '"rm" command printed' ' echo frotz >test-file && git add test-file && git commit -m "add file for rm test" && - git rm test-file >rm-output && - test $(grep "^rm " rm-output | wc -l) = 1 && - rm -f test-file rm-output && + git rm test-file >rm-output.raw && + grep "^rm " rm-output.raw >rm-output && + test_line_count = 1 rm-output && + rm -f test-file rm-output.raw rm-output && git commit -m "remove file from rm test" '