unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Hong Xu <hong@topbug.net>
To: Matt Armstrong <marmstrong@google.com>
Cc: 25086@debbugs.gnu.org
Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string.
Date: Thu, 01 Dec 2016 22:13:27 -0800	[thread overview]
Message-ID: <87lgvyuad4.fsf@topbug.net> (raw)
In-Reply-To: <qf5fum6ubn4.fsf@marmstrong-macbookpro.roam.corp.google.com>


[-- Attachment #1.1: Type: text/plain, Size: 696 bytes --]


On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong <marmstrong@google.com> wrote:

> Hong Xu <hong@topbug.net> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: parse-test.patch --]
[-- Type: text/x-diff, Size: 1044 bytes --]

diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/parse-time-tests.el
index 9bcf2b4a53c7..6b2b7af0694b 100644
--- 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 +0100")
                  '(42 35 19 22 2 2016 1 nil 3600)))
   (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT")
-                 '(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))))
 
 (provide 'parse-time-tests)
 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  parent reply	other threads:[~2016-12-02  6:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02  3:46 bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string Hong Xu
2016-12-02  3:55 ` Hong Xu
2016-12-02  4:04   ` Hong Xu
     [not found]     ` <qf5fum6ubn4.fsf@marmstrong-macbookpro.roam.corp.google.com>
2016-12-02  6:13       ` Hong Xu [this message]
2016-12-12  0:37         ` Hong Xu
2016-12-12 17:22           ` Matt Armstrong
2016-12-12 17:58             ` Eli Zaretskii
2016-12-17 14:58     ` Eli Zaretskii
2016-12-17 20:42       ` Hong Xu
2016-12-18  3:11         ` Hong Xu
2016-12-24 12:41           ` Eli Zaretskii
2016-12-24 21:04             ` Hong Xu
2016-12-25  3:29               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lgvyuad4.fsf@topbug.net \
    --to=hong@topbug.net \
    --cc=25086@debbugs.gnu.org \
    --cc=marmstrong@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).