test-elmo-date.el: New file.
authorkaoru <kaoru>
Fri, 15 Feb 2008 01:12:23 +0000 (01:12 +0000)
committerkaoru <kaoru>
Fri, 15 Feb 2008 01:12:23 +0000 (01:12 +0000)
tests/ChangeLog
tests/test-elmo-date.el [new file with mode: 0644]

index e1418c7..aeb5413 100644 (file)
@@ -1,3 +1,7 @@
+2008-02-15  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * test-elmo-date.el: New file.
+
 2006-11-03  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * test-wl-draft.el: New file.
diff --git a/tests/test-elmo-date.el b/tests/test-elmo-date.el
new file mode 100644 (file)
index 0000000..635a774
--- /dev/null
@@ -0,0 +1,18 @@
+(require 'lunit)
+(require 'elmo-date)
+
+(luna-define-class test-elmo-date (lunit-test-case))
+
+(luna-define-method test-elmo-date-get-week ((case test-elmo-date))
+  "Check around singularity date. leap year and 2038-01-19."
+  (let ((elmo-lang "en"))
+    (lunit-assert
+     (string= "Tue" (elmo-date-get-week 2000 2 29)))
+    (lunit-assert
+     (string= "Tue" (elmo-date-get-week 2038 1 19)))
+    (lunit-assert
+     (string= "Wed" (elmo-date-get-week 2038 1 20)))
+    (lunit-assert
+     (string= "Sun" (elmo-date-get-week 2100 2 28)))
+    (lunit-assert
+     (string= "Mon" (elmo-date-get-week 2100 3 1)))))