aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert2018-09-21 14:24:42 -0700
committerPaul Eggert2018-09-21 14:25:19 -0700
commit0bec064454adac2bdff04a11bbdfaa79aa4ce052 (patch)
treeab85b4e46d2ab44dd3d02b85a5a540470842e470 /test
parent167274d44f1ccaee65a5b68e15c3ed79a53447d1 (diff)
downloademacs-0bec064454adac2bdff04a11bbdfaa79aa4ce052.tar.gz
emacs-0bec064454adac2bdff04a11bbdfaa79aa4ce052.zip
Fix ambiguity in nil DST flag
Formerly nil meant both that DST was not in effect and that the DST flag was unknown, and different functions interpreted the flag differently. Now the meaning is consistently nil for DST not in effect, and -1 for DST flag not known. * doc/lispref/os.texi (Time Conversion): The DST slot is now three-valued, not two-. * doc/misc/emacs-mime.texi (time-date): Adjust to new behavior. * etc/NEWS: Mention this. * lisp/calendar/parse-time.el (parse-time-string): * src/editfns.c (Fdecode_time): Return -1 for unknown DST flag. * test/lisp/calendar/parse-time-tests.el (parse-time-tests): Adjust tests to match new behavior, and add a new test for nil vs -1.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/calendar/parse-time-tests.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/parse-time-tests.el
index 3a956a56621..9689997f793 100644
--- a/test/lisp/calendar/parse-time-tests.el
+++ b/test/lisp/calendar/parse-time-tests.el
@@ -28,21 +28,23 @@
28 28
29(ert-deftest parse-time-tests () 29(ert-deftest parse-time-tests ()
30 (should (equal (parse-time-string "Mon, 22 Feb 2016 19:35:42 +0100") 30 (should (equal (parse-time-string "Mon, 22 Feb 2016 19:35:42 +0100")
31 '(42 35 19 22 2 2016 1 nil 3600))) 31 '(42 35 19 22 2 2016 1 -1 3600)))
32 (should (equal (parse-time-string "22 Feb 2016 19:35:42 +0100") 32 (should (equal (parse-time-string "22 Feb 2016 19:35:42 +0100")
33 '(42 35 19 22 2 2016 nil nil 3600))) 33 '(42 35 19 22 2 2016 nil -1 3600)))
34 (should (equal (parse-time-string "22 Feb 2016 +0100") 34 (should (equal (parse-time-string "22 Feb 2016 +0100")
35 '(nil nil nil 22 2 2016 nil nil 3600))) 35 '(nil nil nil 22 2 2016 nil -1 3600)))
36 (should (equal (parse-time-string "Mon, 22 Feb 16 19:35:42 +0100") 36 (should (equal (parse-time-string "Mon, 22 Feb 16 19:35:42 +0100")
37 '(42 35 19 22 2 2016 1 nil 3600))) 37 '(42 35 19 22 2 2016 1 -1 3600)))
38 (should (equal (parse-time-string "Mon, 22 February 2016 19:35:42 +0100") 38 (should (equal (parse-time-string "Mon, 22 February 2016 19:35:42 +0100")
39 '(42 35 19 22 2 2016 1 nil 3600))) 39 '(42 35 19 22 2 2016 1 -1 3600)))
40 (should (equal (parse-time-string "Mon, 22 feb 2016 19:35:42 +0100") 40 (should (equal (parse-time-string "Mon, 22 feb 2016 19:35:42 +0100")
41 '(42 35 19 22 2 2016 1 nil 3600))) 41 '(42 35 19 22 2 2016 1 -1 3600)))
42 (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +0100") 42 (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +0100")
43 '(42 35 19 22 2 2016 1 nil 3600))) 43 '(42 35 19 22 2 2016 1 -1 3600)))
44 (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT") 44 (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PST")
45 '(42 35 19 22 2 2016 1 t -25200))) 45 '(42 35 19 22 2 2016 1 nil -28800)))
46 (should (equal (parse-time-string "Friday, 21 Sep 2018 13:47:58 PDT")
47 '(58 47 13 21 9 2018 5 t -25200)))
46 (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200") 48 (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200")
47 '(13818 33666))) 49 '(13818 33666)))
48 (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0230") 50 (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0230")