diff options
| author | Paul Eggert | 2019-04-30 10:45:48 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-30 10:47:17 -0700 |
| commit | 325f51c84d9ad4d9776784bd324b347ffe4fe51b (patch) | |
| tree | 105c43ee218925018d5e778a0b8d52fc02307e69 /test/src | |
| parent | 35ef33dd234707d611e2a307a3500b4dbcf46cf6 (diff) | |
| download | emacs-325f51c84d9ad4d9776784bd324b347ffe4fe51b.tar.gz emacs-325f51c84d9ad4d9776784bd324b347ffe4fe51b.zip | |
Fix decode-time/encode-time roundtrip on macOS
* src/timefns.c (Fencode_time): Ignore DST flag when the zone is
numeric or is a cons, as the doc string says it’s ignored in that
case, and not ignoring it causes encode-time to not invert
decode-time on some platforms (Bug#35502).
* test/src/timefns-tests.el (encode-time-dst-numeric-zone):
New test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/timefns-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el index 5c858ef3bd8..2c90af757f0 100644 --- a/test/src/timefns-tests.el +++ b/test/src/timefns-tests.el | |||
| @@ -142,3 +142,9 @@ | |||
| 142 | (< 0.99 (/ x y) 1.01) | 142 | (< 0.99 (/ x y) 1.01) |
| 143 | (< 0.99 (/ (- (float-time a)) (float-time b)) | 143 | (< 0.99 (/ (- (float-time a)) (float-time b)) |
| 144 | 1.01)))))))) | 144 | 1.01)))))))) |
| 145 | |||
| 146 | (ert-deftest encode-time-dst-numeric-zone () | ||
| 147 | "Check for Bug#35502." | ||
| 148 | (should (time-equal-p | ||
| 149 | (encode-time '(29 31 17 30 4 2019 2 t 7200)) | ||
| 150 | '(23752 27217)))) | ||