diff options
| author | dickmao | 2021-11-21 09:18:57 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-11-21 09:20:06 +0100 |
| commit | 867c57029c4d71b9378d34dfbdd975dca8a104f4 (patch) | |
| tree | 8e6376477a8035ae2449e261664c90c8b3556546 /test/lisp | |
| parent | 2a4a32eddbee7bd8759cf5f64be5d948a68b2caa (diff) | |
| download | emacs-867c57029c4d71b9378d34dfbdd975dca8a104f4.tar.gz emacs-867c57029c4d71b9378d34dfbdd975dca8a104f4.zip | |
Fix icalendar time zone parsing
* lisp/calendar/icalendar.el (icalendar--decode-isodatetime):
Parse time zones more correctly.
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--decode-isodatetime): Fix tests so that they work
in other time zones than Europe/Berlin (bug#51959).
Diffstat (limited to 'test/lisp')
| -rw-r--r-- | test/lisp/calendar/icalendar-tests.el | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el index 10b684aacbe..1551922028c 100644 --- a/test/lisp/calendar/icalendar-tests.el +++ b/test/lisp/calendar/icalendar-tests.el | |||
| @@ -1635,26 +1635,30 @@ SUMMARY:NNN Wwwwwwww Wwwww - Aaaaaa Pppppppp rrrrrr ddd oo Nnnnnnnn 30 | |||
| 1635 | 1635 | ||
| 1636 | (ert-deftest icalendar-tests--decode-isodatetime () | 1636 | (ert-deftest icalendar-tests--decode-isodatetime () |
| 1637 | "Test `icalendar--decode-isodatetime'." | 1637 | "Test `icalendar--decode-isodatetime'." |
| 1638 | (should (equal (icalendar-test--format "20040917T050910-0200") | 1638 | (should (equal (icalendar-test--format "20040917T050910-02:00") |
| 1639 | "2004-09-17T03:09:10+0000")) | ||
| 1640 | (should (equal (icalendar-test--format "20040917T050910") | ||
| 1641 | "2004-09-17T03:09:10+0000")) | 1639 | "2004-09-17T03:09:10+0000")) |
| 1640 | (let ((orig (icalendar-test--format "20040917T050910"))) | ||
| 1641 | (unwind-protect | ||
| 1642 | (progn | ||
| 1643 | (set-time-zone-rule "UTC-02:00") | ||
| 1644 | (should (equal (icalendar-test--format "20040917T050910") | ||
| 1645 | "2004-09-17T03:09:10+0000")) | ||
| 1646 | (should (equal (icalendar-test--format "20040917T0509") | ||
| 1647 | "2004-09-17T03:09:00+0000")) | ||
| 1648 | (should (equal (icalendar-test--format "20040917") | ||
| 1649 | "2004-09-16T22:00:00+0000")) | ||
| 1650 | (should (equal (icalendar-test--format "20040917T050910" 1) | ||
| 1651 | "2004-09-18T03:09:10+0000")) | ||
| 1652 | (should (equal (icalendar-test--format "20040917T050910" 30) | ||
| 1653 | "2004-10-17T03:09:10+0000"))) | ||
| 1654 | (set-time-zone-rule 'wall) ;; (set-time-zone-rule nil) is broken | ||
| 1655 | (should (equal orig (icalendar-test--format "20040917T050910"))))) | ||
| 1642 | (should (equal (icalendar-test--format "20040917T050910Z") | 1656 | (should (equal (icalendar-test--format "20040917T050910Z") |
| 1643 | "2004-09-17T05:09:10+0000")) | 1657 | "2004-09-17T05:09:10+0000")) |
| 1644 | (should (equal (icalendar-test--format "20040917T0509") | 1658 | (should (equal (icalendar-test--format "20040917T050910" -1 0) |
| 1645 | "2004-09-17T03:09:00+0000")) | 1659 | "2004-09-16T05:09:10+0000")) |
| 1646 | (should (equal (icalendar-test--format "20040917") | ||
| 1647 | "2004-09-16T22:00:00+0000")) | ||
| 1648 | (should (equal (icalendar-test--format "20040917T050910" 1) | ||
| 1649 | "2004-09-18T03:09:10+0000")) | ||
| 1650 | (should (equal (icalendar-test--format "20040917T050910" 30) | ||
| 1651 | "2004-10-17T03:09:10+0000")) | ||
| 1652 | (should (equal (icalendar-test--format "20040917T050910" -1) | ||
| 1653 | "2004-09-16T03:09:10+0000")) | ||
| 1654 | |||
| 1655 | (should (equal (icalendar-test--format "20040917T050910" nil -3600) | 1660 | (should (equal (icalendar-test--format "20040917T050910" nil -3600) |
| 1656 | "2004-09-17T06:09:10+0000"))) | 1661 | "2004-09-17T06:09:10+0000"))) |
| 1657 | 1662 | ||
| 1658 | |||
| 1659 | (provide 'icalendar-tests) | 1663 | (provide 'icalendar-tests) |
| 1660 | ;;; icalendar-tests.el ends here | 1664 | ;;; icalendar-tests.el ends here |