From patchwork Fri Apr 14 08:13:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Rybak X-Patchwork-Id: 13211099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1CA8C77B71 for ; Fri, 14 Apr 2023 08:14:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjDNIOC (ORCPT ); Fri, 14 Apr 2023 04:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbjDNIOA (ORCPT ); Fri, 14 Apr 2023 04:14:00 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7DED2738 for ; Fri, 14 Apr 2023 01:13:58 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id h8so2145409ljf.3 for ; Fri, 14 Apr 2023 01:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681460036; x=1684052036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j2unZZ0tkwjTB6Nef/MJvYMRgoZQUGroeYnEdH+E8r0=; b=WkTsHgs9h1euc5/xe8IIHi/5TdGIgHMyyoIAm+3qPhJgejBMIMDlPvf9OoIpZwj/jY 8ZrAqPvPVkxJxVfp53FUQGWe9bXfZS4AvLNs2gpJX2gFbApqt1JerQR6GmTfPSnpeJ6s bFR/g2FUR6GsyhVmEp7U/VPXRTlLX7rWoxRXV+PxP0Dex+Ol7pcdtxf9ELQ82WCmlw+X R6HanDwFKrcES045DbFeHehi+zm4dXPv03ISvhU5GxjV1IN6OIfLIOqmIfriAyGEnWyE JhqaDESJerxAhloaT9T9NuORe9TWcEeS8dvyRGKKsY6eKm/Y9gIPybFGr0nH/EMWNXzp BTFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681460036; x=1684052036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j2unZZ0tkwjTB6Nef/MJvYMRgoZQUGroeYnEdH+E8r0=; b=Ge1gV3OizNBwnIAwldsemk+QTWwdWWivG4orXpvAeUV6lKCGs3dOshRQCn/pGuZ/Rb il4HLBpsKm6CFpt26jsKZ5zL3GgpFeO9nZf24cgZo9VuE0N8Dan6iU0wxsIfPmZitD13 3soGBUtG+Ap9gczSXLcJwBx/jYw2WwWHooV13MReztJYflxKT/5lBakvMBE6X59/lb7B 0k9ey9ei2cCaQiq6McbIR6sfdNy0u1FEWIio7Sy5bioXL2muDda3P4IqE8J1hbrHrPIU Hwv+cVa7eSizlBHcLagywRHcZYK9tWzqNVIVN1DMBS9S/JKAQ2j7vniBmJTSTGcI77SU usAQ== X-Gm-Message-State: AAQBX9c1ouRUTY3w4P0kcisEJAV0l3tSOS78rVCMqbNEmtbBG7c8uTQQ dEzTu+iB1uKeyhA3U9AgIgn7/WGyVkT34i1ezkw= X-Google-Smtp-Source: AKy350Y/XQeOC46BLU/0pubAzRchZoDatNjdbBSsDc3zCvX/+FDe642RS5McDifhJHChMPtvokIUSw== X-Received: by 2002:a2e:b0db:0:b0:29f:390:6647 with SMTP id g27-20020a2eb0db000000b0029f03906647mr1773862ljl.18.1681460036597; Fri, 14 Apr 2023 01:13:56 -0700 (PDT) Received: from titov.fritz.box ([195.246.120.47]) by smtp.gmail.com with ESMTPSA id d9-20020a2e3309000000b002a76f63a657sm657506ljc.105.2023.04.14.01.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 01:13:56 -0700 (PDT) From: Andrei Rybak To: git@vger.kernel.org Cc: Patrick Steinhardt , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFy?= =?utf-8?b?bWFzb24=?= , Johannes Schindelin , =?utf-8?q?=C3=98ystein_Wa?= =?utf-8?q?lle?= , Junio C Hamano Subject: [PATCH v1 1/2] t1300: drop duplicate test Date: Fri, 14 Apr 2023 10:13:51 +0200 Message-Id: <20230414081352.810296-2-rybak.a.v@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230414081352.810296-1-rybak.a.v@gmail.com> References: <7a5de047-3535-3b87-f023-43c400d57131@gmail.com> <20230414081352.810296-1-rybak.a.v@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There are two almost identical tests called 'git config ignores pairs with zero count' in file t1300-config.sh. Drop the first of these and keep the one that contains more assertions. Signed-off-by: Andrei Rybak --- t/t1300-config.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 2575279ab8..696dca17c6 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -1458,13 +1458,6 @@ test_expect_success 'git config ignores pairs without count' ' test_must_be_empty error ' -test_expect_success 'git config ignores pairs with zero count' ' - test_must_fail env \ - GIT_CONFIG_COUNT=0 \ - GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \ - git config pair.one -' - test_expect_success 'git config ignores pairs exceeding count' ' GIT_CONFIG_COUNT=1 \ GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \ From patchwork Fri Apr 14 08:13:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Rybak X-Patchwork-Id: 13211100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 692BCC77B70 for ; Fri, 14 Apr 2023 08:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbjDNIOE (ORCPT ); Fri, 14 Apr 2023 04:14:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjDNIOA (ORCPT ); Fri, 14 Apr 2023 04:14:00 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F65F271F for ; Fri, 14 Apr 2023 01:13:59 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id b40so1941391lfv.4 for ; Fri, 14 Apr 2023 01:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681460037; x=1684052037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dtMPaTstwxS2FtFjw7Pt74StX9wReDixP8n6nXt2bes=; b=FGP6gEPGzq21mCHQP0XQSlXFP2JbTb0S2QJgxxPj2/9LLxPWM+V2JtfHOl+vICoDTr Q8Jxn+wczptbUdjA+Vjgir0AQWYBmY0ZLyeodMrE02Isa8iojecU3D0WV0h2TrHVUY+I i+YVlifQVVYkvr8Ct/KKCflQDgDabq67V2Qtv7fF7dV69u692+oD/VTS4L8OjWZ7yukq BWSLEI2BzuV1CMNKF9Tm7QypK4Rxdltv+s4IbHzai85dq4ZswP3lSK28EW1cP4p7qPUo hhzoGg8v/crsriO705dlqa13KcAQQ7Yta/wjuQR7F/COZMVGux10DdjBYVOSr8XTiSq2 B4AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681460037; x=1684052037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dtMPaTstwxS2FtFjw7Pt74StX9wReDixP8n6nXt2bes=; b=OHiGmR0pcxK6jN5YAmXoD/B93g5dHdUkdQpAuQbqnCag7bIXdNpdHbtTY9T+ktgTSW /3gS+FVJ5lvG8stjR7KfGTZb+9es9pbX+feD5tdO+b5HD2VK61BmBp+1AbLU5IFY9Vvf NrkR9+PIgBRWuR6oW2uyZyK0rESGt9NrCwmpLhcuCuvbT/87vT9F1Ai3eX5eNPvlVrlq 9CJhHrtCkay0EqkEUls9yJ+QZR9XN9DecfqRGyPdOR0caogSFF9tUyb7soRYoMu0EE4o cKDYUdapnOn4eUjW3TDQzZ71vQlHUyhlOWJg9n/bfiSAuD5eIPQleyCg+du5gDkJXglG l6cQ== X-Gm-Message-State: AAQBX9e9JClFzzF94fDjNTXnyVAexzVytEWQvPraCUIuS0VONWRZJ0Kb nwHxA01OTPr7i+n135w/1GpSUQpqO1nmRQPyOjM= X-Google-Smtp-Source: AKy350Zv9ElfyUAnDtZplL8hLMkcS7PUebHUtohV5xsNDWtcivucuo7UgRHRPXJ4VffwwcYN2g6DUg== X-Received: by 2002:a19:ae17:0:b0:4ec:5607:9055 with SMTP id f23-20020a19ae17000000b004ec56079055mr1576869lfc.31.1681460037445; Fri, 14 Apr 2023 01:13:57 -0700 (PDT) Received: from titov.fritz.box ([195.246.120.47]) by smtp.gmail.com with ESMTPSA id d9-20020a2e3309000000b002a76f63a657sm657506ljc.105.2023.04.14.01.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 01:13:57 -0700 (PDT) From: Andrei Rybak To: git@vger.kernel.org Cc: Patrick Steinhardt , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFy?= =?utf-8?b?bWFzb24=?= , Johannes Schindelin , =?utf-8?q?=C3=98ystein_Wa?= =?utf-8?q?lle?= , Junio C Hamano Subject: [PATCH v1 2/2] t1300: check stderr for "ignores pairs" tests Date: Fri, 14 Apr 2023 10:13:52 +0200 Message-Id: <20230414081352.810296-3-rybak.a.v@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230414081352.810296-1-rybak.a.v@gmail.com> References: <7a5de047-3535-3b87-f023-43c400d57131@gmail.com> <20230414081352.810296-1-rybak.a.v@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Tests "git config ignores pairs ..." in t1300-config.sh validate that "git config" ignores with various kinds of supplied pairs of environment variables GIT_CONFIG_KEY_* GIT_CONFIG_VALUE_* that should be ingored. By "ignores" here we mean that "git config" doesn't complain about them to standard error. This is validated by redirecting the standard error to a file called "error" and asserting that it is empty. However, two of these tests incorrectly redirect to standard output while calling the file "error", and test 'git config ignores pairs exceeding count' doesn't validate standard error at all. Fix it by redirecting standard error to file "error" and asserting its emptiness. Signed-off-by: Andrei Rybak --- t/t1300-config.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 696dca17c6..20a15ede5c 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -1462,24 +1462,25 @@ test_expect_success 'git config ignores pairs exceeding count' ' GIT_CONFIG_COUNT=1 \ GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \ GIT_CONFIG_KEY_1="pair.two" GIT_CONFIG_VALUE_1="value" \ - git config --get-regexp "pair.*" >actual && + git config --get-regexp "pair.*" >actual 2>error && cat >expect <<-EOF && pair.one value EOF - test_cmp expect actual + test_cmp expect actual && + test_must_be_empty error ' test_expect_success 'git config ignores pairs with zero count' ' test_must_fail env \ GIT_CONFIG_COUNT=0 GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \ - git config pair.one >error && + git config pair.one 2>error && test_must_be_empty error ' test_expect_success 'git config ignores pairs with empty count' ' test_must_fail env \ GIT_CONFIG_COUNT= GIT_CONFIG_KEY_0="pair.one" GIT_CONFIG_VALUE_0="value" \ - git config pair.one >error && + git config pair.one 2>error && test_must_be_empty error '