diff options
Diffstat (limited to 'test/src/editfns-tests.el')
-rw-r--r-- | test/src/editfns-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index 487f3aaa666..4a840c8d7d1 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -253,6 +253,16 @@ (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z" nil (concat (make-string 2048 ?X) "0"))))) +(defun editfns-tests--have-leap-seconds () + (string-equal (format-time-string "%Y-%m-%d %H:%M:%S" 78796800 t) + "1972-06-30 23:59:60")) + +(ert-deftest format-time-string-with-bignum-on-32-bit () + (should (or (string-equal + (format-time-string "%Y-%m-%d %H:%M:%S" (- (ash 1 31) 3600) t) + "2038-01-19 02:14:08") + (editfns-tests--have-leap-seconds)))) + (ert-deftest format-with-field () (should (equal (format "First argument %2$s, then %3$s, then %1$s" 1 2 3) "First argument 2, then 3, then 1")) |