New test for function-get
* test/lisp/subr-tests.el (subr-tests-function-get): New test.
This commit is contained in:
parent
119931a9ce
commit
4194d5af45
1 changed files with 16 additions and 0 deletions
|
@ -1285,6 +1285,22 @@ final or penultimate step during initialization."))
|
|||
(nconc cycle cycle)
|
||||
(should-not (plistp cycle))))
|
||||
|
||||
(defun subr-tests--some-fun ())
|
||||
(defalias 'subr-tests--some-alias #'subr-tests--some-fun)
|
||||
|
||||
(ert-deftest subr-tests-function-get ()
|
||||
(unwind-protect
|
||||
(progn
|
||||
(should (eq (function-get 'subr-tests--some-fun 'prop) nil))
|
||||
(should (eq (function-get 'subr-tests--some-alias 'prop) nil))
|
||||
;; With the function symbol directly.
|
||||
(function-put 'subr-tests--some-fun 'prop 'value)
|
||||
(should (eq (function-get 'subr-tests--some-fun 'prop) 'value))
|
||||
;; With an alias.
|
||||
(should (eq (function-get 'subr-tests--some-alias 'prop) 'value))
|
||||
(function-put 'subr-tests--some-alias 'prop 'value))
|
||||
(function-put 'subr-tests--some-fun 'prop nil)))
|
||||
|
||||
(defun subr-tests--butlast-ref (list &optional n)
|
||||
"Reference implementation of `butlast'."
|
||||
(let ((m (or n 1))
|
||||
|
|
Loading…
Add table
Reference in a new issue