diff options
| author | Paul Eggert | 2021-12-05 17:38:58 -0800 |
|---|---|---|
| committer | Paul Eggert | 2021-12-05 23:24:08 -0800 |
| commit | 0d88c3c340ec09f449a2a843205cdcabae799fe1 (patch) | |
| tree | 7264f30b53b41abbccd5f5369d15b6882ef93bc2 | |
| parent | 4434deaee2aa9d8c6b9631690c6376f78a9b057f (diff) | |
| download | emacs-0d88c3c340ec09f449a2a843205cdcabae799fe1.tar.gz emacs-0d88c3c340ec09f449a2a843205cdcabae799fe1.zip | |
Add time-convert tests
* test/src/timefns-tests.el (time-convert-forms): New test.
| -rw-r--r-- | test/src/timefns-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el index bba9b3fcd8c..f801478a9a1 100644 --- a/test/src/timefns-tests.el +++ b/test/src/timefns-tests.el | |||
| @@ -242,4 +242,16 @@ a fixed place on the right and are padded on the left." | |||
| 242 | (should (= xdiv (float-time (time-convert xdiv t)))))) | 242 | (should (= xdiv (float-time (time-convert xdiv t)))))) |
| 243 | (setq x (* x 2))))) | 243 | (setq x (* x 2))))) |
| 244 | 244 | ||
| 245 | (ert-deftest time-convert-forms () | ||
| 246 | ;; These computations involve numbers that should have exact | ||
| 247 | ;; representations on any Emacs platform. | ||
| 248 | (dolist (time '(-86400 -1 0 1 86400)) | ||
| 249 | (dolist (delta '(0 0.0 0.25 3.25 1000 1000.25)) | ||
| 250 | (let ((time+ (+ time delta)) | ||
| 251 | (time- (- time delta))) | ||
| 252 | (dolist (form '(nil t list 4 1000 1000000 1000000000)) | ||
| 253 | (should (time-equal-p time (time-convert time form))) | ||
| 254 | (should (time-equal-p time- (time-convert time- form))) | ||
| 255 | (should (time-equal-p time+ (time-convert time+ form)))))))) | ||
| 256 | |||
| 245 | ;;; timefns-tests.el ends here | 257 | ;;; timefns-tests.el ends here |