diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index df330bf60fc..3459a653283 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -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))