aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/data-tests.el19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 33b00d6c9ad..3cd537859fd 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -1,4 +1,4 @@
1;;; data-tests.el --- tests for src/data.c 1;;; data-tests.el --- tests for src/data.c -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2013-2018 Free Software Foundation, Inc. 3;; Copyright (C) 2013-2018 Free Software Foundation, Inc.
4 4
@@ -499,3 +499,20 @@ comparing the subr with a much slower lisp implementation."
499 (remove-variable-watcher 'data-tests-lvar collect-watch-data) 499 (remove-variable-watcher 'data-tests-lvar collect-watch-data)
500 (setq data-tests-lvar 6) 500 (setq data-tests-lvar 6)
501 (should (null watch-data))))) 501 (should (null watch-data)))))
502
503(ert-deftest data-tests-kill-all-local-variables () ;bug#30846
504 (with-temp-buffer
505 (setq-local data-tests-foo1 1)
506 (setq-local data-tests-foo2 2)
507 (setq-local data-tests-foo3 3)
508 (let ((oldfoo2 nil))
509 (add-variable-watcher 'data-tests-foo2
510 (lambda (&rest _)
511 (setq oldfoo2 (bound-and-true-p data-tests-foo2))))
512 (kill-all-local-variables)
513 (should (equal oldfoo2 '2)) ;Watcher is run before changing the var.
514 (should (not (or (bound-and-true-p data-tests-foo1)
515 (bound-and-true-p data-tests-foo2)
516 (bound-and-true-p data-tests-foo3)))))))
517
518;;; data-tests.el ends here