From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Hong Xu Newsgroups: gmane.emacs.bugs Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string. Date: Thu, 01 Dec 2016 22:13:27 -0800 Message-ID: <87lgvyuad4.fsf@topbug.net> References: <1480650408-26252-1-git-send-email-hong@topbug.net> <874m2nyog6.fsf@topbug.net> <8737i7yo27.fsf@topbug.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1480659260 23371 195.159.176.226 (2 Dec 2016 06:14:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2016 06:14:20 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 25.1.90.2 Cc: 25086@debbugs.gnu.org To: Matt Armstrong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 02 07:14:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCh6u-0005Iz-5l for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 07:14:16 +0100 Original-Received: from localhost ([::1]:60904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCh6x-0001PQ-Jd for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 01:14:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCh6q-0001PK-4n for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 01:14:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCh6k-0007dZ-9v for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 01:14:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33967) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCh6k-0007cD-6z for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 01:14:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cCh6g-0001We-H7 for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2016 01:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Dec 2016 06:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25086-submit@debbugs.gnu.org id=B25086.14806592155817 (code B ref 25086); Fri, 02 Dec 2016 06:14:02 +0000 Original-Received: (at 25086) by debbugs.gnu.org; 2 Dec 2016 06:13:35 +0000 Original-Received: from localhost ([127.0.0.1]:49366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCh6F-0001Vl-6X for submit@debbugs.gnu.org; Fri, 02 Dec 2016 01:13:35 -0500 Original-Received: from sender163-mail.zoho.com ([74.201.84.163]:21359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCh6E-0001Vb-0A for 25086@debbugs.gnu.org; Fri, 02 Dec 2016 01:13:34 -0500 Original-Received: from localhost (cpe-104-32-170-214.socal.res.rr.com [104.32.170.214]) by mx.zohomail.com with SMTPS id 1480659208879157.93331024406666; Thu, 1 Dec 2016 22:13:28 -0800 (PST) In-reply-to: X-Zoho-Virus-Status: 1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126387 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong wrote: > Hong Xu writes: > >> doc/misc/emacs-mime.texi | 3 +++ >> lisp/calendar/parse-time.el | 12 ++++++++---- >> src/editfns.c | 5 ++--- >> 3 files changed, 13 insertions(+), 7 deletions(-) > > Hi Hong, have you seen test/lisp/calendar/parse-time-tests.el? It might > be nice to add test coverage for parse-iso8601-time-string there. Thanks for the reminder. A patch to add tests is attached. Note that I've kept the two patches separate since the one without tests should be applied to the stable branch (since it has no test), but this patch should be applied to master. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=parse-test.patch Content-Transfer-Encoding: quoted-printable diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/pa= rse-time-tests.el index 9bcf2b4a53c7..6b2b7af0694b 100644 =2D-- a/test/lisp/calendar/parse-time-tests.el +++ b/test/lisp/calendar/parse-time-tests.el @@ -42,7 +42,15 @@ (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +01= 00") '(42 35 19 22 2 2016 1 nil 3600))) (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT= ") =2D '(42 35 19 22 2 2016 1 t -25200)))) + '(42 35 19 22 2 2016 1 t -25200))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02") + '(13818 33666))) + (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02") + '(13818 19266)))) =20 (provide 'parse-time-tests) =20 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYQREHAAoJECZsfTOCL4R44AYP/2LThICq9Yjy0SmqLR7pZm+N VZFoQDB9pnnUHuk9G7AEAVLvzw/Yiu3u2jV0ks8qNisImDJ8+fgywKQnxJeIoU/k JflJQcA9sECv6LDg4MTadtHanAJzpEAIfoaFdtEGypvbJBZ396fFwTarlNVTfr3U Nh6s+YmZy4gU2tyX8DDjlQ3SpRXDjfuRJuDHiKd/97t4qALU49PGN7X2U1fFKmbU UqwBIHYz+fZ/4mRQshY0FVm4cN3YOqAHVNVrV9NuGLRGJPqM8mSEACTaAPJmiUap LcZJE3NZRZEyeCci1jWgtge5QZ1vi/Wa+7ofxgwxhS+ck+nj3SRJcAPn9ooyRWYr t8G0RL/YZP0jYlRCiyEsJqF56RNKk49On1JozgUDuMrCCIWJa0jeqBE79+e5v8eT Mn/MiSdofr04naNbsdiAoBsZ3faweLkQKsJE/GGie8kC/0UH4q7V4M9JcgI91puk vT8a4UONOS3AdjgYzzpV2xJw3l29VLzZxRIN1aeuge7XNn9gdaSz+7q9IQnmK9R5 TQXKZYR8QnDdKPa3EvJ+xdlr51gz3XlFfrojVncIAkDTa+OOXjh1LJfwAyBCxHxG 3a0kLEHgr6/8mYKzuynRUIUvLoRf5AlPC6kdhrDN6Nl6mHgargyc6kS4tc4K7bUd MZFh8pcUon0k2x3o5zDk =6c8G -----END PGP SIGNATURE----- --==-=-=--