Add test for apply-partially
* test/lisp/subr-tests.el (subr-test-apply-partially): New test.
This commit is contained in:
parent
8a3e19f4b3
commit
4ea2197f72
1 changed files with 13 additions and 0 deletions
|
@ -30,6 +30,19 @@
|
|||
(require 'ert-x)
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
|
||||
(ert-deftest subr-test-apply-partially ()
|
||||
(should (functionp (apply-partially #'identity)))
|
||||
(should (functionp (apply-partially #'list 1 2 3)))
|
||||
(should (equal (mapcar (apply-partially #'identity) '(9 cups of sugar))
|
||||
'(9 cups of sugar)))
|
||||
(should (equal (mapcar (apply-partially #'eq 3) '(3 spoons of butter))
|
||||
'(t nil nil nil)))
|
||||
(should (equal (funcall (apply-partially #'list 1 2 3) 4)
|
||||
'(1 2 3 4)))
|
||||
(let* ((a 1) (b 2) (c 3)
|
||||
(fun (apply-partially #'list a b c)))
|
||||
(should (equal (funcall fun 4) '(1 2 3 4)))))
|
||||
|
||||
(ert-deftest subr-test-zerop ()
|
||||
(should (zerop 0))
|
||||
(should (zerop 0.0))
|
||||
|
|
Loading…
Add table
Reference in a new issue