diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/data-tests.el | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el index dda1278b6d4..91463db113c 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 | ||
| @@ -484,3 +484,20 @@ comparing the subr with a much slower lisp implementation." | |||
| 484 | (remove-variable-watcher 'data-tests-lvar collect-watch-data) | 484 | (remove-variable-watcher 'data-tests-lvar collect-watch-data) |
| 485 | (setq data-tests-lvar 6) | 485 | (setq data-tests-lvar 6) |
| 486 | (should (null watch-data))))) | 486 | (should (null watch-data))))) |
| 487 | |||
| 488 | (ert-deftest data-tests-kill-all-local-variables () ;bug#30846 | ||
| 489 | (with-temp-buffer | ||
| 490 | (setq-local data-tests-foo1 1) | ||
| 491 | (setq-local data-tests-foo2 2) | ||
| 492 | (setq-local data-tests-foo3 3) | ||
| 493 | (let ((oldfoo2 nil)) | ||
| 494 | (add-variable-watcher 'data-tests-foo2 | ||
| 495 | (lambda (&rest _) | ||
| 496 | (setq oldfoo2 (bound-and-true-p data-tests-foo2)))) | ||
| 497 | (kill-all-local-variables) | ||
| 498 | (should (equal oldfoo2 '2)) ;Watcher is run before changing the var. | ||
| 499 | (should (not (or (bound-and-true-p data-tests-foo1) | ||
| 500 | (bound-and-true-p data-tests-foo2) | ||
| 501 | (bound-and-true-p data-tests-foo3))))))) | ||
| 502 | |||
| 503 | ;;; data-tests.el ends here | ||