Add test for zerop
* test/lisp/subr-tests.el (subr-test-zerop): New test.
This commit is contained in:
parent
e779d60ea1
commit
f2fb19d008
1 changed files with 15 additions and 0 deletions
|
@ -30,6 +30,21 @@
|
|||
(require 'ert-x)
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
|
||||
(ert-deftest subr-test-zerop ()
|
||||
(should (zerop 0))
|
||||
(should (zerop 0.0))
|
||||
(should (zerop -0))
|
||||
(should (zerop -0.0))
|
||||
(should-not (zerop -0.0e+NaN))
|
||||
(should-not (zerop 0.0e+NaN))
|
||||
(should-not (zerop float-pi))
|
||||
(should-not (zerop 1.0e+INF))
|
||||
(should-not (zerop (random most-positive-fixnum)))
|
||||
(should-not (zerop (- (random (- most-negative-fixnum)))))
|
||||
(should-not (zerop (1+ most-positive-fixnum)))
|
||||
(should-not (zerop (1- most-negative-fixnum)))
|
||||
(should-error (zerop "-5") :type 'wrong-type-argument))
|
||||
|
||||
(ert-deftest let-when-compile ()
|
||||
;; good case
|
||||
(should (equal (macroexpand '(let-when-compile ((foo (+ 2 3)))
|
||||
|
|
Loading…
Add table
Reference in a new issue