diff options
| author | Stephen Gildea | 2019-10-26 14:31:22 -0700 |
|---|---|---|
| committer | Stephen Gildea | 2019-10-26 14:31:39 -0700 |
| commit | f247599e167d34be93badd693a8b4de15daa0a8e (patch) | |
| tree | 75b98b3a50f02b201304a94eb0a7a40d3d69a5b5 | |
| parent | 54477c6177a25c1c96b6de06c7049a3d204f276b (diff) | |
| download | emacs-f247599e167d34be93badd693a8b4de15daa0a8e.tar.gz emacs-f247599e167d34be93badd693a8b4de15daa0a8e.zip | |
time-stamp-tests: add name prefix to tests of formatting
* time-stamp-tests.el: rename all the time-stamp-string formatting tests
to have the word "format" in their name, to make room in the namespace
for other, future tests.
| -rw-r--r-- | test/lisp/time-stamp-tests.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el index d01d37a6648..92df1839350 100644 --- a/test/lisp/time-stamp-tests.el +++ b/test/lisp/time-stamp-tests.el | |||
| @@ -57,7 +57,7 @@ | |||
| 57 | 57 | ||
| 58 | ;;; Tests: | 58 | ;;; Tests: |
| 59 | 59 | ||
| 60 | (ert-deftest time-stamp-test-day-of-week () | 60 | (ert-deftest time-stamp-test-format-day-of-week () |
| 61 | "Test time-stamp formats for named day of week." | 61 | "Test time-stamp formats for named day of week." |
| 62 | (with-time-stamp-test-env | 62 | (with-time-stamp-test-env |
| 63 | ;; implemented and documented since 1997 | 63 | ;; implemented and documented since 1997 |
| @@ -76,7 +76,7 @@ | |||
| 76 | (should (equal (time-stamp-string "%^a" ref-time1) "MON")) | 76 | (should (equal (time-stamp-string "%^a" ref-time1) "MON")) |
| 77 | (should (equal (time-stamp-string "%A" ref-time1) "Monday")))) | 77 | (should (equal (time-stamp-string "%A" ref-time1) "Monday")))) |
| 78 | 78 | ||
| 79 | (ert-deftest time-stamp-test-month-name () | 79 | (ert-deftest time-stamp-test-format-month-name () |
| 80 | "Test time-stamp formats for month name." | 80 | "Test time-stamp formats for month name." |
| 81 | (with-time-stamp-test-env | 81 | (with-time-stamp-test-env |
| 82 | ;; implemented and documented since 1997 | 82 | ;; implemented and documented since 1997 |
| @@ -95,7 +95,7 @@ | |||
| 95 | (should (equal (time-stamp-string "%^b" ref-time1) "JAN")) | 95 | (should (equal (time-stamp-string "%^b" ref-time1) "JAN")) |
| 96 | (should (equal (time-stamp-string "%B" ref-time1) "January")))) | 96 | (should (equal (time-stamp-string "%B" ref-time1) "January")))) |
| 97 | 97 | ||
| 98 | (ert-deftest time-stamp-test-day-of-month () | 98 | (ert-deftest time-stamp-test-format-day-of-month () |
| 99 | "Test time-stamp formats for day of month." | 99 | "Test time-stamp formats for day of month." |
| 100 | (with-time-stamp-test-env | 100 | (with-time-stamp-test-env |
| 101 | ;; implemented and documented since 1995 | 101 | ;; implemented and documented since 1995 |
| @@ -118,7 +118,7 @@ | |||
| 118 | (should (equal (time-stamp-string "%d" ref-time1) "02")) | 118 | (should (equal (time-stamp-string "%d" ref-time1) "02")) |
| 119 | (should (equal (time-stamp-string "%d" ref-time2) "18")))) | 119 | (should (equal (time-stamp-string "%d" ref-time2) "18")))) |
| 120 | 120 | ||
| 121 | (ert-deftest time-stamp-test-hours-24 () | 121 | (ert-deftest time-stamp-test-format-hours-24 () |
| 122 | "Test time-stamp formats for hour on a 24-hour clock." | 122 | "Test time-stamp formats for hour on a 24-hour clock." |
| 123 | (with-time-stamp-test-env | 123 | (with-time-stamp-test-env |
| 124 | ;; implemented and documented since 1995 | 124 | ;; implemented and documented since 1995 |
| @@ -148,7 +148,7 @@ | |||
| 148 | (should (equal (time-stamp-string "%H" ref-time2) "12")) | 148 | (should (equal (time-stamp-string "%H" ref-time2) "12")) |
| 149 | (should (equal (time-stamp-string "%H" ref-time3) "06")))) | 149 | (should (equal (time-stamp-string "%H" ref-time3) "06")))) |
| 150 | 150 | ||
| 151 | (ert-deftest time-stamp-test-hours-12 () | 151 | (ert-deftest time-stamp-test-format-hours-12 () |
| 152 | "Test time-stamp formats for hour on a 12-hour clock." | 152 | "Test time-stamp formats for hour on a 12-hour clock." |
| 153 | (with-time-stamp-test-env | 153 | (with-time-stamp-test-env |
| 154 | ;; implemented and documented since 1995 | 154 | ;; implemented and documented since 1995 |
| @@ -178,7 +178,7 @@ | |||
| 178 | (should (equal (time-stamp-string "%I" ref-time2) "12")) | 178 | (should (equal (time-stamp-string "%I" ref-time2) "12")) |
| 179 | (should (equal (time-stamp-string "%I" ref-time3) "06")))) | 179 | (should (equal (time-stamp-string "%I" ref-time3) "06")))) |
| 180 | 180 | ||
| 181 | (ert-deftest time-stamp-test-month-number () | 181 | (ert-deftest time-stamp-test-format-month-number () |
| 182 | "Test time-stamp formats for month number." | 182 | "Test time-stamp formats for month number." |
| 183 | (with-time-stamp-test-env | 183 | (with-time-stamp-test-env |
| 184 | ;; implemented and documented since 1995 | 184 | ;; implemented and documented since 1995 |
| @@ -201,7 +201,7 @@ | |||
| 201 | (should (equal (time-stamp-string "%m" ref-time1) "01")) | 201 | (should (equal (time-stamp-string "%m" ref-time1) "01")) |
| 202 | (should (equal (time-stamp-string "%m" ref-time2) "11")))) | 202 | (should (equal (time-stamp-string "%m" ref-time2) "11")))) |
| 203 | 203 | ||
| 204 | (ert-deftest time-stamp-test-minute () | 204 | (ert-deftest time-stamp-test-format-minute () |
| 205 | "Test time-stamp formats for minute." | 205 | "Test time-stamp formats for minute." |
| 206 | (with-time-stamp-test-env | 206 | (with-time-stamp-test-env |
| 207 | ;; implemented and documented since 1995 | 207 | ;; implemented and documented since 1995 |
| @@ -224,7 +224,7 @@ | |||
| 224 | (should (equal (time-stamp-string "%M" ref-time1) "04")) | 224 | (should (equal (time-stamp-string "%M" ref-time1) "04")) |
| 225 | (should (equal (time-stamp-string "%M" ref-time2) "14")))) | 225 | (should (equal (time-stamp-string "%M" ref-time2) "14")))) |
| 226 | 226 | ||
| 227 | (ert-deftest time-stamp-test-second () | 227 | (ert-deftest time-stamp-test-format-second () |
| 228 | "Test time-stamp formats for second." | 228 | "Test time-stamp formats for second." |
| 229 | (with-time-stamp-test-env | 229 | (with-time-stamp-test-env |
| 230 | ;; implemented and documented since 1995 | 230 | ;; implemented and documented since 1995 |
| @@ -247,7 +247,7 @@ | |||
| 247 | (should (equal (time-stamp-string "%S" ref-time1) "05")) | 247 | (should (equal (time-stamp-string "%S" ref-time1) "05")) |
| 248 | (should (equal (time-stamp-string "%S" ref-time2) "15")))) | 248 | (should (equal (time-stamp-string "%S" ref-time2) "15")))) |
| 249 | 249 | ||
| 250 | (ert-deftest time-stamp-test-year-2digit () | 250 | (ert-deftest time-stamp-test-format-year-2digit () |
| 251 | "Test time-stamp formats for %y." | 251 | "Test time-stamp formats for %y." |
| 252 | (with-time-stamp-test-env | 252 | (with-time-stamp-test-env |
| 253 | ;; implemented and documented since 1995 | 253 | ;; implemented and documented since 1995 |
| @@ -272,13 +272,13 @@ | |||
| 272 | (time-stamp-should-warn | 272 | (time-stamp-should-warn |
| 273 | (equal (time-stamp-string "%4y" ref-time1) "2006")))) | 273 | (equal (time-stamp-string "%4y" ref-time1) "2006")))) |
| 274 | 274 | ||
| 275 | (ert-deftest time-stamp-test-year-4digit () | 275 | (ert-deftest time-stamp-test-format-year-4digit () |
| 276 | "Test time-stamp format %Y." | 276 | "Test time-stamp format %Y." |
| 277 | (with-time-stamp-test-env | 277 | (with-time-stamp-test-env |
| 278 | ;; implemented since 1997, documented since 2019 | 278 | ;; implemented since 1997, documented since 2019 |
| 279 | (should (equal (time-stamp-string "%Y" ref-time1) "2006")))) | 279 | (should (equal (time-stamp-string "%Y" ref-time1) "2006")))) |
| 280 | 280 | ||
| 281 | (ert-deftest time-stamp-test-am-pm () | 281 | (ert-deftest time-stamp-test-format-am-pm () |
| 282 | "Test time-stamp formats for AM and PM strings." | 282 | "Test time-stamp formats for AM and PM strings." |
| 283 | (with-time-stamp-test-env | 283 | (with-time-stamp-test-env |
| 284 | ;; implemented and documented since 1997 | 284 | ;; implemented and documented since 1997 |
| @@ -290,14 +290,14 @@ | |||
| 290 | (should (equal (time-stamp-string "%p" ref-time1) "PM")) | 290 | (should (equal (time-stamp-string "%p" ref-time1) "PM")) |
| 291 | (should (equal (time-stamp-string "%p" ref-time3) "AM")))) | 291 | (should (equal (time-stamp-string "%p" ref-time3) "AM")))) |
| 292 | 292 | ||
| 293 | (ert-deftest time-stamp-test-day-number-in-week () | 293 | (ert-deftest time-stamp-test-format-day-number-in-week () |
| 294 | "Test time-stamp formats for day number in week." | 294 | "Test time-stamp formats for day number in week." |
| 295 | (with-time-stamp-test-env | 295 | (with-time-stamp-test-env |
| 296 | (should (equal (time-stamp-string "%w" ref-time1) "1")) | 296 | (should (equal (time-stamp-string "%w" ref-time1) "1")) |
| 297 | (should (equal (time-stamp-string "%w" ref-time2) "5")) | 297 | (should (equal (time-stamp-string "%w" ref-time2) "5")) |
| 298 | (should (equal (time-stamp-string "%w" ref-time3) "0")))) | 298 | (should (equal (time-stamp-string "%w" ref-time3) "0")))) |
| 299 | 299 | ||
| 300 | (ert-deftest time-stamp-test-time-zone () | 300 | (ert-deftest time-stamp-test-format-time-zone () |
| 301 | "Test time-stamp formats for time zone." | 301 | "Test time-stamp formats for time zone." |
| 302 | (with-time-stamp-test-env | 302 | (with-time-stamp-test-env |
| 303 | (let ((UTC-abbr (format-time-string "%Z" ref-time1 t)) | 303 | (let ((UTC-abbr (format-time-string "%Z" ref-time1 t)) |
| @@ -309,7 +309,7 @@ | |||
| 309 | ;; implemented since 1997, documented since 2019 | 309 | ;; implemented since 1997, documented since 2019 |
| 310 | (should (equal (time-stamp-string "%#Z" ref-time1) utc-abbr))))) | 310 | (should (equal (time-stamp-string "%#Z" ref-time1) utc-abbr))))) |
| 311 | 311 | ||
| 312 | (ert-deftest time-stamp-test-non-date-conversions () | 312 | (ert-deftest time-stamp-test-format-non-date-conversions () |
| 313 | "Test time-stamp formats for non-date items." | 313 | "Test time-stamp formats for non-date items." |
| 314 | (with-time-stamp-test-env | 314 | (with-time-stamp-test-env |
| 315 | ;; implemented and documented since 1995 | 315 | ;; implemented and documented since 1995 |
| @@ -333,7 +333,7 @@ | |||
| 333 | (should (equal | 333 | (should (equal |
| 334 | (time-stamp-string "%q" ref-time1) "test-system-name")))) | 334 | (time-stamp-string "%q" ref-time1) "test-system-name")))) |
| 335 | 335 | ||
| 336 | (ert-deftest time-stamp-test-ignored-modifiers () | 336 | (ert-deftest time-stamp-test-format-ignored-modifiers () |
| 337 | "Test additional args allowed (but ignored) to allow for future expansion." | 337 | "Test additional args allowed (but ignored) to allow for future expansion." |
| 338 | (with-time-stamp-test-env | 338 | (with-time-stamp-test-env |
| 339 | ;; allowed modifiers | 339 | ;; allowed modifiers |
| @@ -341,12 +341,12 @@ | |||
| 341 | ;; not all punctuation is allowed | 341 | ;; not all punctuation is allowed |
| 342 | (should-not (equal (time-stamp-string "%&P" ref-time3) "AM")))) | 342 | (should-not (equal (time-stamp-string "%&P" ref-time3) "AM")))) |
| 343 | 343 | ||
| 344 | (ert-deftest time-stamp-test-non-conversions () | 344 | (ert-deftest time-stamp-test-format-non-conversions () |
| 345 | "Test that without a %, the text is copied literally." | 345 | "Test that without a %, the text is copied literally." |
| 346 | (with-time-stamp-test-env | 346 | (with-time-stamp-test-env |
| 347 | (should (equal (time-stamp-string "No percent" ref-time1) "No percent")))) | 347 | (should (equal (time-stamp-string "No percent" ref-time1) "No percent")))) |
| 348 | 348 | ||
| 349 | (ert-deftest time-stamp-test-string-width () | 349 | (ert-deftest time-stamp-test-format-string-width () |
| 350 | "Test time-stamp string width modifiers." | 350 | "Test time-stamp string width modifiers." |
| 351 | (with-time-stamp-test-env | 351 | (with-time-stamp-test-env |
| 352 | ;; strings truncate on the right or are blank-padded on the left | 352 | ;; strings truncate on the right or are blank-padded on the left |