diff options
Diffstat (limited to 'test/lisp/faces-tests.el')
| -rw-r--r-- | test/lisp/faces-tests.el | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index 7cba4b26ebe..eb8c533b8e6 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el | |||
| @@ -23,6 +23,11 @@ | |||
| 23 | (require 'ert) | 23 | (require 'ert) |
| 24 | (require 'faces) | 24 | (require 'faces) |
| 25 | 25 | ||
| 26 | (defvar faces--test-data-dir | ||
| 27 | (expand-file-name "../data/" | ||
| 28 | (file-name-directory (or load-file-name | ||
| 29 | buffer-file-name)))) | ||
| 30 | |||
| 26 | (defgroup faces--test nil "" | 31 | (defgroup faces--test nil "" |
| 27 | :group 'faces--test) | 32 | :group 'faces--test) |
| 28 | 33 | ||
| @@ -117,8 +122,9 @@ | |||
| 117 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 122 | (should (equal (face-attribute 'diff-changed-face :extend) t)) |
| 118 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) | 123 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) |
| 119 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 124 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) |
| 120 | (load-theme 'manoj-dark t t) | 125 | (add-to-list 'custom-theme-load-path (concat faces--test-data-dir "themes")) |
| 121 | (load-theme 'tsdh-light t t) | 126 | (load-theme 'faces-test-dark t t) |
| 127 | (load-theme 'faces-test-light t t) | ||
| 122 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 128 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| 123 | 'unspecified)) | 129 | 'unspecified)) |
| 124 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) | 130 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) |
| @@ -129,7 +135,7 @@ | |||
| 129 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 135 | (should (equal (face-attribute 'diff-changed-face :extend) t)) |
| 130 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) | 136 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) |
| 131 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 137 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) |
| 132 | (enable-theme 'manoj-dark) | 138 | (enable-theme 'faces-test-dark) |
| 133 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 139 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| 134 | 'unspecified)) | 140 | 'unspecified)) |
| 135 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) | 141 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) |
| @@ -137,14 +143,14 @@ | |||
| 137 | 'unspecified)) | 143 | 'unspecified)) |
| 138 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) | 144 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) |
| 139 | nil)) | 145 | nil)) |
| 140 | (should (equal (face-attribute 'diff-changed-face :extend) 'unspecified)) ; should be t | 146 | (should (equal (face-attribute 'diff-changed-face :extend) t)) |
| 141 | (should (equal (face-attribute 'diff-added :extend) t)) | 147 | (should (equal (face-attribute 'diff-added :extend) t)) |
| 142 | (should (equal (face-attribute 'diff-file-header-face :extend) 'unspecified)) ; should be nil | 148 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) |
| 143 | (defface faces--test-face3 | 149 | (defface faces--test-face3 |
| 144 | '((t :inherit diff-added :weight bold)) | 150 | '((t :inherit diff-added :weight bold)) |
| 145 | "") | 151 | "") |
| 146 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 152 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 147 | (disable-theme 'manoj-dark) | 153 | (disable-theme 'faces-test-dark) |
| 148 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 154 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| 149 | 'unspecified)) | 155 | 'unspecified)) |
| 150 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) | 156 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) |
| @@ -159,7 +165,7 @@ | |||
| 159 | (defface diff-indicator-changed | 165 | (defface diff-indicator-changed |
| 160 | '((t (:weight bold :extend t))) | 166 | '((t (:weight bold :extend t))) |
| 161 | "") | 167 | "") |
| 162 | (enable-theme 'tsdh-light) | 168 | (enable-theme 'faces-test-light) |
| 163 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 169 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| 164 | 'unspecified)) | 170 | 'unspecified)) |
| 165 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) | 171 | (should (equal (face-attribute 'faces--test-inherit-extend :extend nil t) t)) |
| @@ -170,7 +176,7 @@ | |||
| 170 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 176 | (should (equal (face-attribute 'diff-changed-face :extend) t)) |
| 171 | (should (equal (face-attribute 'diff-added :extend) t)) | 177 | (should (equal (face-attribute 'diff-added :extend) t)) |
| 172 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 178 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) |
| 173 | (should (equal (face-attribute 'diff-indicator-changed :extend) 'unspecified)) ; should be t | 179 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) |
| 174 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 180 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 175 | (frame-set-background-mode (selected-frame) 'dark) | 181 | (frame-set-background-mode (selected-frame) 'dark) |
| 176 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 182 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| @@ -183,7 +189,7 @@ | |||
| 183 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 189 | (should (equal (face-attribute 'diff-changed-face :extend) t)) |
| 184 | (should (equal (face-attribute 'diff-added :extend) t)) | 190 | (should (equal (face-attribute 'diff-added :extend) t)) |
| 185 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 191 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) |
| 186 | (should (equal (face-attribute 'diff-indicator-changed :extend) 'unspecified)) ; should be t | 192 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) |
| 187 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 193 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 188 | (or noninteractive | 194 | (or noninteractive |
| 189 | (let ((fr (make-frame))) | 195 | (let ((fr (make-frame))) |
| @@ -200,11 +206,10 @@ | |||
| 200 | (should (equal (face-attribute 'diff-changed-face :extend fr) t)) | 206 | (should (equal (face-attribute 'diff-changed-face :extend fr) t)) |
| 201 | (should (equal (face-attribute 'diff-added :extend fr) t)) | 207 | (should (equal (face-attribute 'diff-added :extend fr) t)) |
| 202 | (should (equal (face-attribute 'diff-file-header-face :extend fr) nil)) | 208 | (should (equal (face-attribute 'diff-file-header-face :extend fr) nil)) |
| 203 | (should (equal (face-attribute 'diff-indicator-changed :extend fr) | 209 | (should (equal (face-attribute 'diff-indicator-changed :extend fr) t)) |
| 204 | 'unspecified)) ; should be t | ||
| 205 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 210 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 206 | )) | 211 | )) |
| 207 | (disable-theme 'tsdh-light) | 212 | (disable-theme 'faces-test-light) |
| 208 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) | 213 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) |
| 209 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) | 214 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) |
| 210 | (or noninteractive | 215 | (or noninteractive |