aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPo Lu2024-07-22 09:56:08 +0800
committerPo Lu2024-07-22 09:56:08 +0800
commitda0165a01e01dcb4334feee03b462ac09ceb0f8c (patch)
treec707b09510f6c41d636e59c7fbbf4f9d81d37b86 /test/src
parent4868a17396b6796b77285a3608b383aac32aee4f (diff)
downloademacs-da0165a01e01dcb4334feee03b462ac09ceb0f8c.tar.gz
emacs-da0165a01e01dcb4334feee03b462ac09ceb0f8c.zip
Prohibit unbinding of built-in variables
* src/data.c (set_internal): Signal error if a BLV with a redirect or a forwarded symbol is being unbound. * test/src/data-tests.el (binding-test-makunbound-built-in): New test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/data-tests.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index a1959f62fd3..a631aabb605 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -219,6 +219,16 @@ comparing the subr with a much slower Lisp implementation."
219 do (error "FAILED testcase %S %3S %3S %3S" 219 do (error "FAILED testcase %S %3S %3S %3S"
220 pos lf cnt rcnt))))) 220 pos lf cnt rcnt)))))
221 221
222(ert-deftest binding-test-makunbound-built-in ()
223 "Verify that attempts to `makunbound' built-in symbols are rejected."
224 (should-error (makunbound 'initial-window-system))
225 (let ((initial-window-system 'x))
226 (should-error (makunbound 'initial-window-system)))
227 (should-error
228 (makunbound (make-local-variable 'initial-window-system)))
229 (let ((initial-window-system 'x))
230 (should-error (makunbound 'initial-window-system))))
231
222(defconst bool-vector-test-vectors 232(defconst bool-vector-test-vectors
223'("" 233'(""
224 "0" 234 "0"
@@ -874,5 +884,4 @@ comparing the subr with a much slower Lisp implementation."
874 ((eq subtype 'function) (cl-functionp val)) 884 ((eq subtype 'function) (cl-functionp val))
875 (t (should-not (cl-typep val subtype)))))))))) 885 (t (should-not (cl-typep val subtype))))))))))
876 886
877
878;;; data-tests.el ends here 887;;; data-tests.el ends here