diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/calendar/calendar-tests.el | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/lisp/calendar/calendar-tests.el b/test/lisp/calendar/calendar-tests.el index 2aef0bf827b..5fd974f952f 100644 --- a/test/lisp/calendar/calendar-tests.el +++ b/test/lisp/calendar/calendar-tests.el | |||
| @@ -30,5 +30,36 @@ | |||
| 30 | (should (eq (calendar-date-is-valid-p (list 1 2)) nil)) | 30 | (should (eq (calendar-date-is-valid-p (list 1 2)) nil)) |
| 31 | (should (eq (calendar-date-is-valid-p (list 5 1 2025)) t))) | 31 | (should (eq (calendar-date-is-valid-p (list 5 1 2025)) t))) |
| 32 | 32 | ||
| 33 | (ert-deftest calendar-test-date-in-calendar-mode-line () | ||
| 34 | "Test whether the calendar mode line displays `date' correctly." | ||
| 35 | (save-window-excursion | ||
| 36 | (unwind-protect | ||
| 37 | (let* ((calendar-mode-line-format (list '(calendar-date-string date))) | ||
| 38 | (calendar-move-hook '(calendar-update-mode-line)) | ||
| 39 | (today (calendar-current-date)) | ||
| 40 | (month (calendar-extract-month today)) | ||
| 41 | (year (calendar-extract-year today)) | ||
| 42 | (cursor-date (calendar-gregorian-from-absolute | ||
| 43 | (1+ (calendar-absolute-from-gregorian today))))) | ||
| 44 | (calendar) | ||
| 45 | (should (equal (string-trim mode-line-format) | ||
| 46 | (calendar-date-string today))) | ||
| 47 | (calendar-forward-day 1) | ||
| 48 | (should (equal (string-trim mode-line-format) | ||
| 49 | (calendar-date-string cursor-date))) | ||
| 50 | (calendar-goto-today) | ||
| 51 | (should (equal (string-trim mode-line-format) | ||
| 52 | (calendar-date-string today))) | ||
| 53 | (calendar-cursor-to-visible-date cursor-date) | ||
| 54 | (calendar-redraw) | ||
| 55 | (should (equal (string-trim mode-line-format) | ||
| 56 | (calendar-date-string cursor-date))) | ||
| 57 | (calendar-cursor-to-visible-date cursor-date) | ||
| 58 | (calendar-scroll-left) | ||
| 59 | (calendar-other-month month year) | ||
| 60 | (should (equal (string-trim mode-line-format) | ||
| 61 | (calendar-date-string cursor-date)))) | ||
| 62 | (kill-buffer calendar-buffer)))) | ||
| 63 | |||
| 33 | (provide 'calendar-tests) | 64 | (provide 'calendar-tests) |
| 34 | ;;; calendar-tests.el ends here | 65 | ;;; calendar-tests.el ends here |