diff options
| author | Paul Eggert | 2017-05-01 16:02:31 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-01 16:03:08 -0700 |
| commit | d36b0c2c80029880809e5a101eeb01da9fd9c219 (patch) | |
| tree | c0a92e2ba170e35bea31547cea4a0a98948e75ad /test/src | |
| parent | 09f566eedaf4bc895d7b762c60a576599f23f142 (diff) | |
| download | emacs-d36b0c2c80029880809e5a101eeb01da9fd9c219.tar.gz emacs-d36b0c2c80029880809e5a101eeb01da9fd9c219.zip | |
Port format-time-string to MS-Windows better
* test/src/editfns-tests.el (format-time-string-with-zone):
Port test cases to MS-Windows.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/editfns-tests.el | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index 7c555d9f9c6..8019eb03838 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el | |||
| @@ -148,25 +148,28 @@ | |||
| 148 | ;; second on 1972-06-30 23:59:60 UTC, so it should format to the | 148 | ;; second on 1972-06-30 23:59:60 UTC, so it should format to the |
| 149 | ;; same string regardless of whether the underlying C library | 149 | ;; same string regardless of whether the underlying C library |
| 150 | ;; ignores leap seconds, while avoiding circa-1970 glitches. | 150 | ;; ignores leap seconds, while avoiding circa-1970 glitches. |
| 151 | (let ((look '(1202 22527 999999 999999))) | 151 | ;; |
| 152 | ;; Similarly, stick to the limited set of time zones that are | ||
| 153 | ;; supported by both POSIX and MS-Windows: exactly 3 ASCII letters | ||
| 154 | ;; in the abbreviation, and no DST. | ||
| 155 | (let ((look '(1202 22527 999999 999999)) | ||
| 156 | (format "%Y-%m-%d %H:%M:%S.%3N %z (%Z)")) | ||
| 152 | ;; UTC. | 157 | ;; UTC. |
| 153 | (should (string-equal | 158 | (should (string-equal |
| 154 | (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z" look t) | 159 | (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z" look t) |
| 155 | "1972-06-30 23:59:59.999 +0000")) | 160 | "1972-06-30 23:59:59.999 +0000")) |
| 156 | ;; Time zone without DST in 1972. | 161 | ;; "UTC0". |
| 157 | (should (string-equal | 162 | (should (string-equal |
| 158 | (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z (%Z)" look "NZST-12") | 163 | (format-time-string format look "UTC0") |
| 159 | "1972-07-01 11:59:59.999 +1200 (NZST)")) | 164 | "1972-06-30 23:59:59.999 +0000 (UTC)")) |
| 160 | ;; United States DST in 1972. | 165 | ;; Negative UTC offset, as a Lisp list. |
| 161 | (should (string-equal | 166 | (should (string-equal |
| 162 | (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z (%Z)" look | 167 | (format-time-string format look '(-28800 "PST")) |
| 163 | "PST8PDT,M4.5.0,M10.5.0") | 168 | "1972-06-30 15:59:59.999 -0800 (PST)")) |
| 164 | "1972-06-30 16:59:59.999 -0700 (PDT)")) | 169 | ;; Positive UTC offset that is not an hour multiple, as a string. |
| 165 | ;; New South Wales DST in 1971-2. | ||
| 166 | (should (string-equal | 170 | (should (string-equal |
| 167 | (format-time-string "%Y-%m-%d %H:%M:%S.%3N %z (%Z)" look | 171 | (format-time-string format look "IST-5:30") |
| 168 | "AEST-10AEDT,M10.5.0,M2.5.0/3") | 172 | "1972-07-01 05:29:59.999 +0530 (IST)")))) |
| 169 | "1972-07-01 09:59:59.999 +1000 (AEST)")))) | ||
| 170 | 173 | ||
| 171 | ;;; This should not dump core. | 174 | ;;; This should not dump core. |
| 172 | (ert-deftest format-time-string-with-outlandish-zone () | 175 | (ert-deftest format-time-string-with-outlandish-zone () |