* test-elmo-util.el (test-elmo-delete-cr-1): New testcase.
[elisp/wanderlust.git] / tests / test-elmo-date.el
index 635a774..2f1562c 100644 (file)
      (string= "Sun" (elmo-date-get-week 2100 2 28)))
     (lunit-assert
      (string= "Mon" (elmo-date-get-week 2100 3 1)))))
+
+(luna-define-method test-elmo-time-parse-date-string-1 ((case test-elmo-date))
+  ""
+  (lunit-assert
+   ;; [RFC5322] Appendix A.1.1.
+   (equal '(13429 44762)
+         (elmo-time-parse-date-string
+          "Date: Fri, 21 Nov 1997 09:55:06 -0600")))
+  (lunit-assert
+   ;; [RFC5322] Appendix A.1.2.
+   (equal '(16129 19413)
+         (elmo-time-parse-date-string
+          "Date: Tue, 1 Jul 2003 10:52:37 +0200")))
+  ;; (lunit-assert
+  ;;  ;; leapsec
+  ;;  (elmo-time-parse-date-string
+  ;;   "Date: Thu, 1 Jan 2009 08:59:60 +0900"))
+
+
+  (lunit-assert
+   ;; [RFC5322] Appendix A.1.3.
+   (equal '(-424 63838)
+         (elmo-time-parse-date-string
+          "Date: Thu, 13 Feb 1969 23:32:54 -0330")))
+)
+
+(luna-define-method test-elmo-time-parse-date-string-2 ((case test-elmo-date))
+  "Obsolete Date: format"
+  (lunit-assert
+   ;; [RFC5322] Appendix A.5.
+   (equal '(14403 4992)
+         (elmo-time-parse-date-string
+          (concat
+           "Date: Thu,\n"
+           "      13\n"
+           "        Feb\n"
+           "          1969\n"
+           "        23:32\n"
+           "                 -0330 (Newfoundland Time)"))))
+  (lunit-assert
+   ;; [RFC5322] Appendix A.6.2.
+   (equal '(13429 23162)
+         (elmo-time-parse-date-string
+          "Date: 21 Nov 97 09:55:06 GMT")))
+  (lunit-assert
+   ;; [RFC5322] Appendix A.6.3.
+   (equal '(13428 52452)
+         (elmo-time-parse-date-string
+          "Date  : Fri, 21 Nov 1997 09(comment):   55  :  06 -0600"))))