diff options
| author | Stefan Kangas | 2025-03-24 21:20:11 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-03-24 21:20:36 +0100 |
| commit | 4194d5af4585fedfc7f148da72431a67a9c26045 (patch) | |
| tree | f3836a8fba6ca092177ef5b0e317b4b213c01940 /test | |
| parent | 119931a9cee4c25e7c5536c9bb75c038a1cd7cd3 (diff) | |
| download | emacs-4194d5af4585fedfc7f148da72431a67a9c26045.tar.gz emacs-4194d5af4585fedfc7f148da72431a67a9c26045.zip | |
New test for function-get
* test/lisp/subr-tests.el (subr-tests-function-get): New test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/subr-tests.el | 16 |
1 files changed, 16 insertions, 0 deletions
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.")) | |||
| 1285 | (nconc cycle cycle) | 1285 | (nconc cycle cycle) |
| 1286 | (should-not (plistp cycle)))) | 1286 | (should-not (plistp cycle)))) |
| 1287 | 1287 | ||
| 1288 | (defun subr-tests--some-fun ()) | ||
| 1289 | (defalias 'subr-tests--some-alias #'subr-tests--some-fun) | ||
| 1290 | |||
| 1291 | (ert-deftest subr-tests-function-get () | ||
| 1292 | (unwind-protect | ||
| 1293 | (progn | ||
| 1294 | (should (eq (function-get 'subr-tests--some-fun 'prop) nil)) | ||
| 1295 | (should (eq (function-get 'subr-tests--some-alias 'prop) nil)) | ||
| 1296 | ;; With the function symbol directly. | ||
| 1297 | (function-put 'subr-tests--some-fun 'prop 'value) | ||
| 1298 | (should (eq (function-get 'subr-tests--some-fun 'prop) 'value)) | ||
| 1299 | ;; With an alias. | ||
| 1300 | (should (eq (function-get 'subr-tests--some-alias 'prop) 'value)) | ||
| 1301 | (function-put 'subr-tests--some-alias 'prop 'value)) | ||
| 1302 | (function-put 'subr-tests--some-fun 'prop nil))) | ||
| 1303 | |||
| 1288 | (defun subr-tests--butlast-ref (list &optional n) | 1304 | (defun subr-tests--butlast-ref (list &optional n) |
| 1289 | "Reference implementation of `butlast'." | 1305 | "Reference implementation of `butlast'." |
| 1290 | (let ((m (or n 1)) | 1306 | (let ((m (or n 1)) |