mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
New time-equal-p test
* test/src/timefns-tests.el (time-equal-p-NaN-NaN): New test.
This commit is contained in:
parent
6c4559d138
commit
7c17bd2a6d
2 changed files with 6 additions and 1 deletions
|
|
@ -1221,7 +1221,8 @@ time_cmp (Lisp_Object a, Lisp_Object b)
|
|||
|
||||
/* Compare nil to nil correctly, and handle other eq values quicker
|
||||
while we're at it. Compare here rather than earlier, to handle
|
||||
NaNs and check formats. */
|
||||
NaNs. This means (time-equal-p X X) does not signal an error if
|
||||
X is not a valid time value, but that's OK. */
|
||||
if (EQ (a, b))
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,10 @@ a fixed place on the right and are padded on the left."
|
|||
(ert-deftest time-equal-p-nil-nil ()
|
||||
(should (time-equal-p nil nil)))
|
||||
|
||||
(ert-deftest time-equal-p-NaN-NaN ()
|
||||
(let ((x 0.0e+NaN))
|
||||
(should (not (time-equal-p x x)))))
|
||||
|
||||
(ert-deftest time-arith-tests ()
|
||||
(let ((time-values (list 0 -1 1 0.0 -0.0 -1.0 1.0
|
||||
most-negative-fixnum most-positive-fixnum
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue