diff options
| author | Jens Schmidt | 2025-03-14 23:07:11 +0100 |
|---|---|---|
| committer | Stefan Monnier | 2025-03-16 12:52:40 -0400 |
| commit | 7f2e4508cebe76a885b72ca4789ae839d5bd45e1 (patch) | |
| tree | b219eb77c73eed956415017dafa9272b784bcdc2 /test/src | |
| parent | b8104dadbf285d12c356d4cddd28ac3eaf05f263 (diff) | |
| download | emacs-7f2e4508cebe76a885b72ca4789ae839d5bd45e1.tar.gz emacs-7f2e4508cebe76a885b72ca4789ae839d5bd45e1.zip | |
Correctly unload variable aliases.
* src/eval.c (Finternal_delete_indirect_variable): Add function.
* lisp/loadhist.el (loadhist-unload-element): Use it for variable
aliases.
* test/src/eval-tests.el (eval-tests--internal-delete-indirect-variable):
Test function `internal-delete-indirect-variable'.
* test/lisp/loadhist-tests.el (loadhist-test-unload-feature-alias):
* test/lisp/loadhist-resources/loadhist--alias.el: Test unloading of
features that define variable aliases. (Bug#76748)
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/eval-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index c5a46b62ee2..64a108f8744 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el | |||
| @@ -282,6 +282,18 @@ expressions works for identifiers starting with period." | |||
| 282 | (should-error (defvaralias 'eval-tests--my-c 'eval-tests--my-d) | 282 | (should-error (defvaralias 'eval-tests--my-c 'eval-tests--my-d) |
| 283 | :type 'cyclic-variable-indirection)) | 283 | :type 'cyclic-variable-indirection)) |
| 284 | 284 | ||
| 285 | (ert-deftest eval-tests--internal-delete-indirect-variable () | ||
| 286 | (defvar eval-tests--i-d-i-v-var 'foo) | ||
| 287 | (defvaralias 'eval-tests--i-d-i-v-var1 'eval-tests--i-d-i-v-var "Doc string.") | ||
| 288 | (internal-delete-indirect-variable 'eval-tests--i-d-i-v-var1) | ||
| 289 | |||
| 290 | (should (eq (indirect-variable 'eval-tests--i-d-i-v-var1) | ||
| 291 | 'eval-tests--i-d-i-v-var1)) | ||
| 292 | (should-not (boundp 'eval-tests--i-d-i-v-var1)) | ||
| 293 | (should-not (get 'eval-tests--i-d-i-v-var1 'variable-documentation)) | ||
| 294 | |||
| 295 | (should-error (internal-delete-indirect-variable 'eval-tests--i-d-i-v-var))) | ||
| 296 | |||
| 285 | (defvar eval-tests/global-var 'global-value) | 297 | (defvar eval-tests/global-var 'global-value) |
| 286 | (defvar-local eval-tests/buffer-local-var 'default-value) | 298 | (defvar-local eval-tests/buffer-local-var 'default-value) |
| 287 | (ert-deftest eval-tests/default-value () | 299 | (ert-deftest eval-tests/default-value () |