1 ;;; faces-tests.el --- Tests for faces.el -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
5 ;; Author: Artur Malabarba <bruce.connor.am@gmail.com>
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/>.
27 '((t :background "black" :foreground "black"))
34 (ert-deftest faces--test-color-at-point ()
36 (insert (propertize "STRING" 'face '(faces--test2 faces--test1)))
37 (goto-char (point-min))
38 (should (equal (background-color-at-point) "black"))
39 (should (equal (foreground-color-at-point) "black")))
42 (setq-local font-lock-comment-face 'faces--test1)
43 (setq-local font-lock-constant-face 'faces--test2)
44 (insert ";; `symbol'")
45 (font-lock-fontify-region (point-min) (point-max))
46 (goto-char (point-min))
47 (should (equal (background-color-at-point) "black"))
48 (should (equal (foreground-color-at-point) "black"))
50 (should (equal (background-color-at-point) "black"))
51 (should (equal (foreground-color-at-point) "black"))))
53 (provide 'faces-tests)
54 ;;; faces-tests.el ends here