Commit 87a43245 authored by Stephen Gildea's avatar Stephen Gildea
Browse files

Add doc string to time-stamp-tests that didn't have one

* test/lisp/time-stamp-tests.el (formatz-generate-tests,
  formatz-%z-spotcheck): Add doc strings to tests.
parent da200ab0
Pipeline #11466 failed with stages
in 14 seconds
...@@ -904,17 +904,23 @@ the other expected results for hours greater than 99 with non-zero seconds." ...@@ -904,17 +904,23 @@ the other expected results for hours greater than 99 with non-zero seconds."
ert-test-list ert-test-list
(list (list
`(ert-deftest ,(intern (concat "formatz-" form-string "-hhmm")) () `(ert-deftest ,(intern (concat "formatz-" form-string "-hhmm")) ()
,(concat "Tests time-stamp format " form-string
" with whole hours or minutes.")
(should (equal (formatz ,form-string (fz-make+zone 0)) (should (equal (formatz ,form-string (fz-make+zone 0))
,(car hour-mod))) ,(car hour-mod)))
(formatz-hours-exact-helper ,form-string ',(cdr hour-mod)) (formatz-hours-exact-helper ,form-string ',(cdr hour-mod))
(should (equal (formatz ,form-string (fz-make+zone 0 30)) (should (equal (formatz ,form-string (fz-make+zone 0 30))
,(car mins-mod))) ,(car mins-mod)))
(formatz-nonzero-minutes-helper ,form-string ',(cdr mins-mod))) (formatz-nonzero-minutes-helper ,form-string ',(cdr mins-mod)))
`(ert-deftest ,(intern (concat "formatz-" form-string "-secs")) () `(ert-deftest ,(intern (concat "formatz-" form-string "-seconds")) ()
,(concat "Tests time-stamp format " form-string
" with offsets that have non-zero seconds.")
(should (equal (formatz ,form-string (fz-make+zone 0 0 30)) (should (equal (formatz ,form-string (fz-make+zone 0 0 30))
,(car secs-mod))) ,(car secs-mod)))
(formatz-nonzero-seconds-helper ,form-string ',(cdr secs-mod))) (formatz-nonzero-seconds-helper ,form-string ',(cdr secs-mod)))
`(ert-deftest ,(intern (concat "formatz-" form-string "-big")) () `(ert-deftest ,(intern (concat "formatz-" form-string "-threedigit")) ()
,(concat "Tests time-stamp format " form-string
" with offsets that are 100 hours or greater.")
(should (equal (formatz ,form-string (fz-make+zone 100)) (should (equal (formatz ,form-string (fz-make+zone 100))
,(car big-mod))) ,(car big-mod)))
(formatz-hours-big-helper ,form-string ',(cdr big-mod)) (formatz-hours-big-helper ,form-string ',(cdr big-mod))
...@@ -954,6 +960,7 @@ the other expected results for hours greater than 99 with non-zero seconds." ...@@ -954,6 +960,7 @@ the other expected results for hours greater than 99 with non-zero seconds."
;; The legacy exception for %z in time-stamp will need to remain ;; The legacy exception for %z in time-stamp will need to remain
;; through at least 2024 and Emacs 28. ;; through at least 2024 and Emacs 28.
(ert-deftest formatz-%z-spotcheck () (ert-deftest formatz-%z-spotcheck ()
"Spot-checks internal implementation of time-stamp format %z."
(should (equal (format-time-offset "%z" (fz-make+zone 0)) "+0000")) (should (equal (format-time-offset "%z" (fz-make+zone 0)) "+0000"))
(should (equal (format-time-offset "%z" (fz-make+zone 0 30)) "+0030")) (should (equal (format-time-offset "%z" (fz-make+zone 0 30)) "+0030"))
(should (equal (format-time-offset "%z" (fz-make+zone 0 0 30)) "+000030")) (should (equal (format-time-offset "%z" (fz-make+zone 0 0 30)) "+000030"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment