1 ;;; faces-tests.el --- Tests for faces.el -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2013-2017 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/>.
26 (defgroup faces--test nil
""
30 '((t :background
"black" :foreground
"black"))
39 (ert-deftest faces--test-color-at-point
()
41 (insert (propertize "STRING" 'face
'(faces--test2 faces--test1
)))
42 (goto-char (point-min))
43 (should (equal (background-color-at-point) "black"))
44 (should (equal (foreground-color-at-point) "black")))
46 (insert (propertize "STRING" 'face
'(:foreground
"black" :background
"black")))
47 (goto-char (point-min))
48 (should (equal (background-color-at-point) "black"))
49 (should (equal (foreground-color-at-point) "black")))
52 (setq-local font-lock-comment-face
'faces--test1
)
53 (setq-local font-lock-constant-face
'faces--test2
)
54 (insert ";; `symbol'")
55 (font-lock-fontify-region (point-min) (point-max))
56 (goto-char (point-min))
57 (should (equal (background-color-at-point) "black"))
58 (should (equal (foreground-color-at-point) "black"))
60 (should (equal (background-color-at-point) "black"))
61 (should (equal (foreground-color-at-point) "black"))))
63 (provide 'faces-tests
)
64 ;;; faces-tests.el ends here