From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61595: [PATCH] 28.3; test/lisp/emacs-lisp/copyright-tests.el: Fix test failure. Date: Sat, 18 Feb 2023 09:29:15 +0200 Message-ID: <83pma7zb1w.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4911"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61595@debbugs.gnu.org To: Xi Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 18 08:30:39 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTHg5-00013v-Bd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Feb 2023 08:30:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTHft-0003fX-0w; Sat, 18 Feb 2023 02:30:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTHfX-0003ev-H0 for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 02:30:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pTHfW-0004o7-Cx for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 02:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTHfW-0002NU-82 for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 02:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61595 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61595-submit@debbugs.gnu.org id=B61595.16767053629047 (code B ref 61595); Sat, 18 Feb 2023 07:30:02 +0000 Original-Received: (at 61595) by debbugs.gnu.org; 18 Feb 2023 07:29:22 +0000 Original-Received: from localhost ([127.0.0.1]:42318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTHer-0002Lr-Mp for submit@debbugs.gnu.org; Sat, 18 Feb 2023 02:29:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTHeq-0002La-C4 for 61595@debbugs.gnu.org; Sat, 18 Feb 2023 02:29:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTHek-0004c8-7J; Sat, 18 Feb 2023 02:29:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=p212YyE0NSaBgm6isMzl5ogaMYsRN1Ub9DYBxr4MeVg=; b=Tjq31jP6iaN2 JC+8yc0JQDKaIg+N5UdWdnd7u4z04Ydt6YOwuDPOtXRgzo0I/PbDSHo2k5L7Uvry6RH48+11+SfHz fdfhnObp5PkJtFewectbfj3fqg2JgwH3wrNw0SNUqjkWqMfF2RCzBsA3BnNqOcXTuts5hQjvJIagw 1kNUoJrDlbLKlmuJicEGlHl8YYsBd/WIp93uqBW4ELHtU0TNWf27f72OB9FvGxelGtEUkAbnOMHG1 3bgeJqXF6kLba6ci/XUzBgJJ6mmNEphCSCev5vOm0TdzIfrB6WdJwN6kg+fnyUaGDHNY3S5SfND+P S1ZKw/mb2Y8Rtal2qIQe9A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTHej-0000mK-2R; Sat, 18 Feb 2023 02:29:13 -0500 In-Reply-To: (message from Xi Lu on Sat, 18 Feb 2023 13:46:07 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255935 Archived-At: > Cc: Xi Lu > From: Xi Lu > Date: Sat, 18 Feb 2023 13:46:07 +0800 > > --- > test/lisp/emacs-lisp/copyright-tests.el | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el > index abb0913a0d7..040071d90d0 100644 > --- a/test/lisp/emacs-lisp/copyright-tests.el > +++ b/test/lisp/emacs-lisp/copyright-tests.el > @@ -59,7 +59,8 @@ test-end-chop > "\nCopyright 2006, 2007, 2008 Foo Bar\n\n") > (copyright-update) > (buffer-substring (- (point-max) 42) (point-max)))) > - "Copyright 2006, 2007, 2008, 2022 Foo Bar\n\n"))) > + (format "Copyright 2006, 2007, 2008, %s Foo Bar\n\n" > + (format-time-string "%Y"))))) > > (ert-deftest test-correct-notice () > (should (equal > @@ -70,7 +71,8 @@ test-correct-notice > (copyright-query nil)) > (copyright-update)) > (buffer-string)) > - "Copyright 2021 FSF\nCopyright 2021, 2022 FSF\n"))) > + (format "Copyright 2021 FSF\nCopyright 2021, %s FSF\n" > + (format-time-string "%Y"))))) What is the failure, and why using format-time-string solves that? That test doesn't fail for me. Please _always_ accompany patches with rationale and the details of the problem necessary to understand the patch and decide whether it is the right solution for the problem. Comments in the code explaining why it does things that are not self-evident (like uses literal years for some and format-time-string for others) is also a welcome habit. Also, this patch lacks the commit log message. Thanks.