From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.bugs Subject: bug#52209: 28.0.60; [PATCH] date-to-time fails on pure dates Date: Thu, 24 Feb 2022 21:58:17 -0500 Message-ID: <25112.17865.651512.505218@orion.rgrjr.com> References: <7c22f300-eedb-da65-db02-e82025ec2f48@cs.ucla.edu> <87bl1428x5.fsf@gnus.org> <25031.40994.286546.498819@orion.rgrjr.com> <87ee5zzjpg.fsf@gnus.org> <25035.12991.328986.987982@orion.rgrjr.com> <87o84z782g.fsf@gnus.org> <25038.8156.470964.935330@orion.rgrjr.com> <87lezz5x92.fsf@gnus.org> <87h7an7bdm.fsf@igel.home> <25040.62646.635818.692654@orion.rgrjr.com> <87mtkd3vee.fsf@gnus.org> <25043.53490.928476.622599@orion.rgrjr.com> <87lezudw3q.fsf@gnus.org> <25046.8337.837242.510788@orion.rgrjr.com> <25105.33397.961104.269676@orion.rgrjr.com> <87wnhphepw.fsf@igel.home> <87ilt9vicd.fsf@gnus.org> <25106.48460.775490.619228@orion.rgrjr.com> <25110.49174.412406.711346@orion.rgrjr.com> <877d9k4o5s.fsf@gnus.org> <25112.10122.651114.221297@orion.rgrjr.com> <878rtz1yhz.fsf@gnus.org> <25112.16315.289584.577920@orion.rgrjr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="E12yyB2x8F" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12743"; mail-complaints-to="usenet@ciao.gmane.io" To: Lars Ingebrigtsen , Andreas Schwab , 52209@debbugs.gnu.org, Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 25 03:59:21 2022 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 1nNQpE-00032I-6S for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 03:59:20 +0100 Original-Received: from localhost ([::1]:41868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNQpC-0005k9-OY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Feb 2022 21:59:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNQow-0005k0-Qa for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 21:59:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNQow-0004Vr-Hz for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 21:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNQow-0000Ur-H1 for bug-gnu-emacs@gnu.org; Thu, 24 Feb 2022 21:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bob Rogers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Feb 2022 02:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52209 X-GNU-PR-Package: emacs Original-Received: via spool by 52209-submit@debbugs.gnu.org id=B52209.16457579021831 (code B ref 52209); Fri, 25 Feb 2022 02:59:02 +0000 Original-Received: (at 52209) by debbugs.gnu.org; 25 Feb 2022 02:58:22 +0000 Original-Received: from localhost ([127.0.0.1]:50913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNQoH-0000TT-SE for submit@debbugs.gnu.org; Thu, 24 Feb 2022 21:58:22 -0500 Original-Received: from rgrjr.com ([69.164.211.47]:51224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNQoF-0000TK-L4 for 52209@debbugs.gnu.org; Thu, 24 Feb 2022 21:58:20 -0500 Original-Received: from rgrjr.com (c-73-16-206-7.hsd1.ma.comcast.net [73.16.206.7]) by rgrjr.com (Postfix on openSUSE) with ESMTP id 3D94B1D6BB2; Fri, 25 Feb 2022 02:58:28 +0000 (UTC) Original-Received: from orion.rgrjr.com (orion.rgrjr.com [192.168.0.3]) by scorpio.rgrjr.com (Postfix on openSUSE GNU/Linux) with ESMTP id E98C45FEC6; Thu, 24 Feb 2022 21:58:18 -0500 (EST) In-Reply-To: <25112.16315.289584.577920@orion.rgrjr.com> X-Mailer: VM 7.19 under Emacs 29.0.50 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" Xref: news.gmane.io gmane.emacs.bugs:227611 Archived-At: --E12yyB2x8F Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit From: Bob Rogers Date: Thu, 24 Feb 2022 21:32:27 -0500 From: Lars Ingebrigtsen Date: Fri, 25 Feb 2022 03:16:56 +0100 Bob Rogers writes: > Here it is; there should be no changes from what I last sent other than > from the suggestions you and Andreas made. Thanks, I got a test error: Hmm. I bet we have a timezone issue . . . Yep; here's a fix, to be applied to the previous patch. -- Bob --E12yyB2x8F Content-Type: text/x-patch Content-Description: Content-Disposition: inline; filename="0001-Fix-an-ietf-drums-parse-date-test-without-TZ.patch" Content-Transfer-Encoding: quoted-printable =46rom 93a92360e5ea514236366f978aa5a71e7662ba1a Mon Sep 17 00:00:00 2001 From: Bob Rogers Date: Thu, 24 Feb 2022 21:55:30 -0500 Subject: [PATCH] Fix an ietf-drums-parse-date test without TZ * test/lisp/mail/ietf-drums-date-tests.el: + (ietf-drums-date-tests): Bug fix: Input to ietf-drums-parse-date= must have a timezone, otherwise the output depends on the test environment TZ. Also add some tests without TZ, & fix indentation= =2E --- test/lisp/mail/ietf-drums-date-tests.el | 36 +++++++++++++++++--------= 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/test/lisp/mail/ietf-drums-date-tests.el b/test/lisp/mail/i= etf-drums-date-tests.el index 2d4b39dfae..5b798077ff 100644 --- a/test/lisp/mail/ietf-drums-date-tests.el +++ b/test/lisp/mail/ietf-drums-date-tests.el @@ -72,18 +72,32 @@ ietf-drums-date-tests ("Friday, 21 Sep 2018 13:47:58 PDT" (58 47 13 21 9 2018 5 t -25200) (23461 22782)) - ("Friday, 21 Sep 2018 13:47:58" - (58 47 13 21 9 2018 5 -1 nil) + ("Friday, 21 Sep 2018 13:47:58 EDT" + (58 47 13 21 9 2018 5 t -14400) (23461 11982)))) - (let* ((input (car case)) - (parsed (cadr case)) - (encoded (caddr case))) - ;; The input should parse the same without RFC822. - (should (equal (ietf-drums-parse-date-string input) pars= ed)) - (should (equal (ietf-drums-parse-date-string input nil t= ) parsed)) - ;; Check the encoded date (the official output, though - ;; the decoded-time is easier to debug). - (should (equal (ietf-drums-parse-date input) encoded))))= + (let* ((input (car case)) + (parsed (cadr case)) + (encoded (caddr case))) + ;; The input should parse the same without RFC822. + (should (equal (ietf-drums-parse-date-string input) parsed)) + (should (equal (ietf-drums-parse-date-string input nil t) parsed= )) + ;; Check the encoded date (the official output, though the + ;; decoded-time is easier to debug). + (should (equal (ietf-drums-parse-date input) encoded)))) + + ;; Test a few without timezones. + (dolist (case '(("Mon, 22 Feb 2016 19:35:42" + (42 35 19 22 2 2016 1 -1 nil)) + ("Friday, 21 Sep 2018 13:47:58" + (58 47 13 21 9 2018 5 -1 nil)))) + (let* ((input (car case)) + (parsed (cadr case))) + ;; The input should parse the same without RFC822. + (should (equal (ietf-drums-parse-date-string input) parsed)) + (should (equal (ietf-drums-parse-date-string input nil t) parsed= )) + ;; We can't check the encoded date here because it will differ + ;; depending on the TZ of the test environment. + )) =20 ;; Two-digit years are not allowed by the "modern" format. (should (equal (ietf-drums-parse-date-string "22 Feb 16 19:35:42 +01= 00") --=20 2.34.1 --E12yyB2x8F--