Add tests for cl-{incf,decf}
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-incf) (cl-lib-test-decf): New tests.
This commit is contained in:
parent
1591b8ab9a
commit
727ffbaaf4
1 changed files with 16 additions and 0 deletions
|
@ -242,6 +242,22 @@
|
|||
(should (= (cl-the integer (cl-incf side-effect)) 1))
|
||||
(should (= side-effect 1))))
|
||||
|
||||
(ert-deftest cl-lib-test-incf ()
|
||||
(let ((var 0))
|
||||
(should (= (cl-incf var) 1))
|
||||
(should (= var 1)))
|
||||
(let ((alist))
|
||||
(should (= (cl-incf (alist-get 'a alist 0)) 1))
|
||||
(should (= (alist-get 'a alist 0) 1))))
|
||||
|
||||
(ert-deftest cl-lib-test-decf ()
|
||||
(let ((var 1))
|
||||
(should (= (cl-decf var) 0))
|
||||
(should (= var 0)))
|
||||
(let ((alist))
|
||||
(should (= (cl-decf (alist-get 'a alist 0)) -1))
|
||||
(should (= (alist-get 'a alist 0) -1))))
|
||||
|
||||
(ert-deftest cl-lib-test-plusp ()
|
||||
(should-not (cl-plusp -1.0e+INF))
|
||||
(should-not (cl-plusp -1.5e2))
|
||||
|
|
Loading…
Add table
Reference in a new issue