aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Branham2020-03-24 19:34:14 -0400
committerEli Zaretskii2020-04-03 14:15:31 +0300
commitf134dfa041b30a8c28484a13c2fa08f2fee27ff5 (patch)
tree3f617c21a88881d2297ef9f407c3fb0adf66099d /test
parentf28166dc9a56111606be8ac50ad38179a66ea636 (diff)
downloademacs-f134dfa041b30a8c28484a13c2fa08f2fee27ff5.tar.gz
emacs-f134dfa041b30a8c28484a13c2fa08f2fee27ff5.zip
Error out if 'date-days-in-month' is given an invalid month
* lisp/calendar/time-date.el (date-days-in-month): Add test for month validity; signal an error if it isn't. (Bug#40217) * test/lisp/calendar/time-date-tests.el (test-days-in-month): Add a test for the new error.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/calendar/time-date-tests.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el
index 4c8f18a7a95..9c90300cfe6 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -31,7 +31,8 @@
31(ert-deftest test-days-in-month () 31(ert-deftest test-days-in-month ()
32 (should (= (date-days-in-month 2004 2) 29)) 32 (should (= (date-days-in-month 2004 2) 29))
33 (should (= (date-days-in-month 2004 3) 31)) 33 (should (= (date-days-in-month 2004 3) 31))
34 (should-not (= (date-days-in-month 1900 3) 28))) 34 (should-not (= (date-days-in-month 1900 3) 28))
35 (should-error (date-days-in-month 2020 15)))
35 36
36(ert-deftest test-ordinal () 37(ert-deftest test-ordinal ()
37 (should (equal (date-ordinal-to-time 2008 271) 38 (should (equal (date-ordinal-to-time 2008 271)