From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS54825 147.75.80.0/22 X-Spam-Status: No, score=-11.4 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 698461F44D for ; Fri, 19 Apr 2024 05:33:26 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=25zhPMSY; dkim-atps=neutral Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0C7E51F22892 for ; Fri, 19 Apr 2024 05:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD6A4BE4B; Fri, 19 Apr 2024 05:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="25zhPMSY" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CD4110A03 for ; Fri, 19 Apr 2024 05:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713504785; cv=none; b=fBH8XLU9MNObzymPPoxKvssmoA4GY4n7jq9H5FQbK8IqMI5h/xjzIFJUUHCk0ay+qvaSOyxk9y63ApRXdnlB0L0s61tt7Q5O086LPFo0mDuPjkCRbcvYz2y/7njbtB4hJPJUhHk7Gn8FQKh5sQdSWIiXmUKehmE/xLlcMQjeouQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713504785; c=relaxed/simple; bh=7iYs1Spfqu/34TNF4eNbUdPyGs/COvi1oVuoQBhsLNs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ckT1XdPOY3q7+hm/iy4xo/zE+y2vZazjobMJXwoC9szeTf9leyQm2/0ro04Vn0u/SHHAUlenVZxA5MOtQeSoRQcmYrO/zbPq/TaBLjoU+qngAK28lGo9dio1LFs0gcmGpC6/3OZ4N8HUu79WBPY9UDtpHYgGTMb+lUG5nw5NFKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--linusa.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=25zhPMSY; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--linusa.bounces.google.com Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-6ed25e9b34aso1435604b3a.3 for ; Thu, 18 Apr 2024 22:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713504782; x=1714109582; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zQ2he/GcZvTqzkyrW5ha10sh4uAen6NC4sWpgEbFsos=; b=25zhPMSY/hj6o5iWB/FX5gb4VBcDLlC9Om+nYNfcIjCFa7x0YvDAv0GyqFYMNpshQr E7xL3XdCLoPQpTULFbVtwNhXryqv6Onyfw8y/6igSU0IIYZFkBzyZE5Rwne0k0ASxveI OD8ptRDAr9hGz5T0elE0vfUzqCbMdZ0VTSoyHdMreLwsWZ+FPlZQa6VXUshKSf4kJEfo Nc2Tdzi9G3oJ0qaq6Ugc+h/zb1tSfPfFBpEW78u/Q0KZs3/ZevrP1xIsmg+xtxvz+2fr suQMTZMnFFQSwyyatxZTjDFesMOmGmYgeuv5eS4+1aqIlLQObV2xgqfHkJnDrYQXa93C +sTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713504782; x=1714109582; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zQ2he/GcZvTqzkyrW5ha10sh4uAen6NC4sWpgEbFsos=; b=fWPDh3jOwhCGIFXSEZszHa7z2/fFWQjVzfpD6syfkv74pVfC3EBQbuktRxpuArpsIb WOv/ine6fZeTEptl45raE0XM15p0kapXnKJgHVLc8G/YTMz+TnpJiCzRSg/IGzU170Cr xNGprB97iGXR++KIkfVlSZjLlEvspg+/Ld9Ln5Kj4XMWQrEo2hH4BInXgmZiEVex0La+ 79BgZj0aSYIKof+A5AeRWsVmbmYDOynoXFEvP66gCyg1h7yJqiJKqjdnQXiMIfDOvUOD y3YIshTSzaLpf+vGY2yREzOgjfpb3JDz1i5LT8u+Gcxq478Dc5Z8cdE4HTSkLCMaSNKP F1hA== X-Forwarded-Encrypted: i=1; AJvYcCUyhQqKVbJY1FCNCPIi7lzRYW8C9ZXdoMDEIMQyzzZkARHe3FHyCUahZQVeiOZoX700UXHWdTeFkahywSrxV1ecXWZe X-Gm-Message-State: AOJu0Yy3Q0wOGfLiDgmVhUwjpRHvnsvwgbqd7pemxadtKTt8ZulkUhKZ 7D/gPLbqzVhlTUciCYbMttpttAT6VhikGgq0hyXXkDd2SNWtmQ0lzIgFr7xW4tK6a1QKgLsth/B VoQ== X-Google-Smtp-Source: AGHT+IGxvljh4q35REOY9ntY4r8dNpzcwf5BVI5w+CnVDx33zpKlyY58xkSddCv1w+Ivok/yYE14/l5GyMw= X-Received: from fine.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2221]) (user=linusa job=sendgmr) by 2002:a05:6a00:2d0e:b0:6ea:f424:85ce with SMTP id fa14-20020a056a002d0e00b006eaf42485cemr130339pfb.0.1713504782334; Thu, 18 Apr 2024 22:33:02 -0700 (PDT) Date: Thu, 18 Apr 2024 22:33:00 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: Message-ID: Subject: Re: [PATCH v2 2/8] trailer: add unit tests for trailer iterator From: Linus Arver To: Linus Arver via GitGitGadget , git@vger.kernel.org Cc: Christian Couder , Junio C Hamano , Emily Shaffer , Josh Steadmon , "Randall S. Becker" , Christian Couder , Kristoffer Haugsbakk Content-Type: text/plain; charset="UTF-8" "Linus Arver via GitGitGadget" writes: > From: Linus Arver > [...] > + { > + "with non-trailer lines in trailer block", > + "subject: foo bar\n" > + "\n" > + /* > + * Even though this trailer block has a non-trailer line > + * in it, it's still a valid trailer block because it's > + * at least 25% trailers and is Git-generated. > + */ In the next reroll (sometime next week?), I should put the ... (see git_generated_prefixes[] in trailer.c). comment up here (where we first mention "Git-generated" trailers) instead of down in the last test case below. > + "not a trailer line\n" > + "not a trailer line\n" > + "not a trailer line\n" > + "Signed-off-by: x\n", > + 1 > + }, > + { > + "with non-trailer lines (one too many) in trailer block", > + "subject: foo bar\n" > + "\n" > + /* > + * This block has only 20% trailers, so it's below the > + * 25% threshold. > + */ > + "not a trailer line\n" > + "not a trailer line\n" > + "not a trailer line\n" > + "not a trailer line\n" > + "Signed-off-by: x\n", > + 0 > + }, > + { > + "with non-trailer lines (only 1) in trailer block, but no Git-generated trailers", > + "subject: foo bar\n" > + "\n" > + /* > + * This block has only 1 non-trailer out of 10 (IOW, 90% > + * trailers) but is not considered a trailer because the > + * 25% threshold only applies to cases where there was a > + * Git-generated trailer (see git_generated_prefixes[] > + * in trailer.c). > + */ > + "Reviewed-by: x\n" > + "Reviewed-by: x\n" > + "Reviewed-by: x\n" > + "Helped-by: x\n" > + "Helped-by: x\n" > + "Helped-by: x\n" > + "Acked-by: x\n" > + "Acked-by: x\n" > + "Acked-by: x\n" > + "not a trailer line\n", > + 0 > + }, > + };