1 ;;; faces-tests.el --- Tests for faces.el -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2013-2016 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")))
41 (insert (propertize "STRING" 'face
'(:foreground
"black" :background
"black")))
42 (goto-char (point-min))
43 (should (equal (background-color-at-point) "black"))
44 (should (equal (foreground-color-at-point) "black")))
47 (setq-local font-lock-comment-face
'faces--test1
)
48 (setq-local font-lock-constant-face
'faces--test2
)
49 (insert ";; `symbol'")
50 (font-lock-fontify-region (point-min) (point-max))
51 (goto-char (point-min))
52 (should (equal (background-color-at-point) "black"))
53 (should (equal (foreground-color-at-point) "black"))
55 (should (equal (background-color-at-point) "black"))
56 (should (equal (foreground-color-at-point) "black"))))
58 (provide 'faces-tests
)
59 ;;; faces-tests.el ends here