diff options
| author | Paul Eggert | 2022-04-25 11:56:48 -0700 |
|---|---|---|
| committer | Paul Eggert | 2022-04-25 12:40:20 -0700 |
| commit | d75e2c12ebbc7a758d1c24d30685e790b703eb64 (patch) | |
| tree | 8c5cd9c875ca7f3d4eb37fe6e94a1db8a1759f15 /test/src | |
| parent | fd1ca094bc43d8fab859e7b78280f9f9693105f1 (diff) | |
| download | emacs-d75e2c12ebbc7a758d1c24d30685e790b703eb64.tar.gz emacs-d75e2c12ebbc7a758d1c24d30685e790b703eb64.zip | |
Support (encode-time (list s m h D M Y))
* src/timefns.c (Fencode_time): Add support for a 6-elt list arg.
Requested by Max Nikulin for Org (bug#54764).
* test/src/timefns-tests.el (encode-time-alternate-apis): New test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/timefns-tests.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el index e7c464472d0..08d06f27d9e 100644 --- a/test/src/timefns-tests.el +++ b/test/src/timefns-tests.el | |||
| @@ -225,6 +225,15 @@ a fixed place on the right and are padded on the left." | |||
| 225 | (encode-time '(29 31 17 30 4 2019 2 t 7200)) | 225 | (encode-time '(29 31 17 30 4 2019 2 t 7200)) |
| 226 | '(23752 27217)))) | 226 | '(23752 27217)))) |
| 227 | 227 | ||
| 228 | (ert-deftest encode-time-alternate-apis () | ||
| 229 | (let* ((time '(30 30 12 15 6 1970)) | ||
| 230 | (time-1 (append time '(nil -1 nil))) | ||
| 231 | (etime (encode-time time))) | ||
| 232 | (should (time-equal-p etime (encode-time time-1))) | ||
| 233 | (should (time-equal-p etime (apply #'encode-time time))) | ||
| 234 | (should (time-equal-p etime (apply #'encode-time time-1))) | ||
| 235 | (should (time-equal-p etime (apply #'encode-time (append time '(nil))))))) | ||
| 236 | |||
| 228 | (ert-deftest float-time-precision () | 237 | (ert-deftest float-time-precision () |
| 229 | (should (= (float-time '(0 1 0 4025)) 1.000000004025)) | 238 | (should (= (float-time '(0 1 0 4025)) 1.000000004025)) |
| 230 | (should (= (float-time '(1000000004025 . 1000000000000)) 1.000000004025)) | 239 | (should (= (float-time '(1000000004025 . 1000000000000)) 1.000000004025)) |