; Revert "Guard terminal par. in XTerm mouse mode"
[emacs.git] / test / automated / core-elisp-tests.el
blobb44bb37cc4fd84cd1d854ce799e5016783951f78
1 ;;; core-elisp-tests.el --- Testing some core Elisp rules
3 ;; Copyright (C) 2013-2016 Free Software Foundation, Inc.
5 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
6 ;; Keywords:
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ;;; Commentary:
25 ;;; Code:
27 (ert-deftest core-elisp-tests-1-defvar-in-let ()
28 "Test some core Elisp rules."
29 (with-temp-buffer
30 ;; Check that when defvar is run within a let-binding, the toplevel default
31 ;; is properly initialized.
32 (should (equal (list (let ((c-e-x 1)) (defvar c-e-x 2) c-e-x) c-e-x)
33 '(1 2)))
34 (should (equal (list (let ((c-e-x 1))
35 (defcustom c-e-x 2 "doc" :group 'blah :type 'integer) c-e-x)
36 c-e-x)
37 '(1 2)))))
39 (ert-deftest core-elisp-tests-2-window-configurations ()
40 "Test properties of window-configurations."
41 (let ((wc (current-window-configuration)))
42 (with-current-buffer (window-buffer (frame-selected-window))
43 (push-mark)
44 (activate-mark))
45 (set-window-configuration wc)
46 (should (or (not mark-active) (mark)))))
48 (ert-deftest core-elisp-tests-3-backquote ()
49 (should (eq 3 (eval ``,,'(+ 1 2)))))
51 (provide 'core-elisp-tests)
52 ;;; core-elisp-tests.el ends here