diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/time-stamp-tests.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index 287b5f486c3..ace5e58e367 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el | |||
| @@ -46,8 +46,7 @@ | |||
| 46 | (put 'with-time-stamp-test-env 'lisp-indent-hook 'defun) | 46 | (put 'with-time-stamp-test-env 'lisp-indent-hook 'defun) |
| 47 | 47 | ||
| 48 | (defmacro time-stamp-should-warn (form) | 48 | (defmacro time-stamp-should-warn (form) |
| 49 | "Similar to `should' but verifies that a format warning is generated. | 49 | "Similar to `should' but verifies that a format warning is generated." |
| 50 | In use before 2019 changes; will be used again after those changes settle." | ||
| 51 | `(let ((warning-count 0)) | 50 | `(let ((warning-count 0)) |
| 52 | (cl-letf (((symbol-function 'time-stamp-conv-warn) | 51 | (cl-letf (((symbol-function 'time-stamp-conv-warn) |
| 53 | (lambda (_old _new) | 52 | (lambda (_old _new) |
| @@ -266,7 +265,10 @@ In use before 2019 changes; will be used again after those changes settle." | |||
| 266 | (should (equal (time-stamp-string "%_y" ref-time) " 6")) | 265 | (should (equal (time-stamp-string "%_y" ref-time) " 6")) |
| 267 | (should (equal (time-stamp-string "%_y" ref-time2) "16")) | 266 | (should (equal (time-stamp-string "%_y" ref-time2) "16")) |
| 268 | (should (equal (time-stamp-string "%y" ref-time) "06")) | 267 | (should (equal (time-stamp-string "%y" ref-time) "06")) |
| 269 | (should (equal (time-stamp-string "%y" ref-time2) "16")))) | 268 | (should (equal (time-stamp-string "%y" ref-time2) "16")) |
| 269 | ;; implemented since 1995, warned since 2019, will change | ||
| 270 | (time-stamp-should-warn (equal (time-stamp-string "%04y" ref-time) "2006")) | ||
| 271 | (time-stamp-should-warn (equal (time-stamp-string "%4y" ref-time) "2006")))) | ||
| 270 | 272 | ||
| 271 | (ert-deftest time-stamp-test-year-4digit () | 273 | (ert-deftest time-stamp-test-year-4digit () |
| 272 | "Test time-stamp format %Y." | 274 | "Test time-stamp format %Y." |