diff options
| author | Dmitry Gutov | 2019-12-10 02:15:55 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2019-12-10 02:16:44 +0200 |
| commit | ac1b6e97b6a6a87e5f36b0f002b4a2d77381e628 (patch) | |
| tree | cd50365e77055ef81a643393f834e8232a505029 | |
| parent | 58fb4c3e68a4a42ad491d0fa2c084e5c39942e2b (diff) | |
| download | emacs-ac1b6e97b6a6a87e5f36b0f002b4a2d77381e628.tar.gz emacs-ac1b6e97b6a6a87e5f36b0f002b4a2d77381e628.zip | |
Rename faces used in faces-tests.el
* test/data/themes/faces-test-light-theme.el:
* test/data/themes/faces-test-dark-theme.el: Update accordingly.
* test/lisp/faces-tests.el (faces--test-extend-with-themes):
Don't use the diff-mode faces. Rename the definitions.
| -rw-r--r-- | test/data/themes/faces-test-dark-theme.el | 6 | ||||
| -rw-r--r-- | test/data/themes/faces-test-light-theme.el | 4 | ||||
| -rw-r--r-- | test/lisp/faces-tests.el | 70 |
3 files changed, 39 insertions, 41 deletions
diff --git a/test/data/themes/faces-test-dark-theme.el b/test/data/themes/faces-test-dark-theme.el index 2c114069f9c..f5e41ccdaf9 100644 --- a/test/data/themes/faces-test-dark-theme.el +++ b/test/data/themes/faces-test-dark-theme.el | |||
| @@ -24,9 +24,9 @@ | |||
| 24 | 24 | ||
| 25 | (custom-theme-set-faces | 25 | (custom-theme-set-faces |
| 26 | 'faces-test-dark | 26 | 'faces-test-dark |
| 27 | '(diff-added ((t (:foreground "Green" :extend t)))) | 27 | '(spiff-added ((t (:foreground "Green" :extend t)))) |
| 28 | '(diff-changed-face ((t (:foreground "Khaki")))) | 28 | '(spiff-changed-face ((t (:foreground "Khaki")))) |
| 29 | '(diff-file-header-face ((t (:background "grey20" :foreground "ivory1"))))) | 29 | '(spiff-file-header-face ((t (:background "grey20" :foreground "ivory1"))))) |
| 30 | 30 | ||
| 31 | (provide-theme 'faces-test-dark) | 31 | (provide-theme 'faces-test-dark) |
| 32 | 32 | ||
diff --git a/test/data/themes/faces-test-light-theme.el b/test/data/themes/faces-test-light-theme.el index fc22d47cf8d..cab4f4130b7 100644 --- a/test/data/themes/faces-test-light-theme.el +++ b/test/data/themes/faces-test-light-theme.el | |||
| @@ -24,8 +24,8 @@ | |||
| 24 | 24 | ||
| 25 | (custom-theme-set-faces | 25 | (custom-theme-set-faces |
| 26 | 'faces-test-light | 26 | 'faces-test-light |
| 27 | '(diff-added ((t (:inherit diff-changed :background "light green" :extend t)))) | 27 | '(spiff-added ((t (:inherit diff-changed :background "light green" :extend t)))) |
| 28 | '(diff-changed ((t (:background "light steel blue"))))) | 28 | '(spiff-changed ((t (:background "light steel blue"))))) |
| 29 | 29 | ||
| 30 | (provide-theme 'faces-test-light) | 30 | (provide-theme 'faces-test-light) |
| 31 | 31 | ||
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index eb8c533b8e6..90604b1269e 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el | |||
| @@ -108,20 +108,18 @@ | |||
| 108 | ) | 108 | ) |
| 109 | 109 | ||
| 110 | (ert-deftest faces--test-extend-with-themes () | 110 | (ert-deftest faces--test-extend-with-themes () |
| 111 | ;; Make sure the diff-mode faces are not defined. | 111 | (defface spiff-changed-face |
| 112 | (should-not (featurep 'diff-mode)) | ||
| 113 | (defface diff-changed-face | ||
| 114 | '((t :extend t :weight bold)) | 112 | '((t :extend t :weight bold)) |
| 115 | "") | 113 | "") |
| 116 | (defface diff-added | 114 | (defface spiff-added |
| 117 | '((t :background "grey")) | 115 | '((t :background "grey")) |
| 118 | "") | 116 | "") |
| 119 | (defface diff-file-header-face | 117 | (defface spiff-file-header-face |
| 120 | '((t :extend nil :foreground "cyan")) | 118 | '((t :extend nil :foreground "cyan")) |
| 121 | "") | 119 | "") |
| 122 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 120 | (should (equal (face-attribute 'spiff-changed-face :extend) t)) |
| 123 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) | 121 | (should (equal (face-attribute 'spiff-added :extend) 'unspecified)) |
| 124 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 122 | (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) |
| 125 | (add-to-list 'custom-theme-load-path (concat faces--test-data-dir "themes")) | 123 | (add-to-list 'custom-theme-load-path (concat faces--test-data-dir "themes")) |
| 126 | (load-theme 'faces-test-dark t t) | 124 | (load-theme 'faces-test-dark t t) |
| 127 | (load-theme 'faces-test-light t t) | 125 | (load-theme 'faces-test-light t t) |
| @@ -132,9 +130,9 @@ | |||
| 132 | 'unspecified)) | 130 | 'unspecified)) |
| 133 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) | 131 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) |
| 134 | nil)) | 132 | nil)) |
| 135 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 133 | (should (equal (face-attribute 'spiff-changed-face :extend) t)) |
| 136 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) | 134 | (should (equal (face-attribute 'spiff-added :extend) 'unspecified)) |
| 137 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 135 | (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) |
| 138 | (enable-theme 'faces-test-dark) | 136 | (enable-theme 'faces-test-dark) |
| 139 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 137 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| 140 | 'unspecified)) | 138 | 'unspecified)) |
| @@ -143,11 +141,11 @@ | |||
| 143 | 'unspecified)) | 141 | 'unspecified)) |
| 144 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) | 142 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) |
| 145 | nil)) | 143 | nil)) |
| 146 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 144 | (should (equal (face-attribute 'spiff-changed-face :extend) t)) |
| 147 | (should (equal (face-attribute 'diff-added :extend) t)) | 145 | (should (equal (face-attribute 'spiff-added :extend) t)) |
| 148 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 146 | (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) |
| 149 | (defface faces--test-face3 | 147 | (defface faces--test-face3 |
| 150 | '((t :inherit diff-added :weight bold)) | 148 | '((t :inherit spiff-added :weight bold)) |
| 151 | "") | 149 | "") |
| 152 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 150 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 153 | (disable-theme 'faces-test-dark) | 151 | (disable-theme 'faces-test-dark) |
| @@ -158,11 +156,11 @@ | |||
| 158 | 'unspecified)) | 156 | 'unspecified)) |
| 159 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) | 157 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) |
| 160 | nil)) | 158 | nil)) |
| 161 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 159 | (should (equal (face-attribute 'spiff-changed-face :extend) t)) |
| 162 | (should (equal (face-attribute 'diff-added :extend) 'unspecified)) | 160 | (should (equal (face-attribute 'spiff-added :extend) 'unspecified)) |
| 163 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 161 | (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) |
| 164 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) | 162 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) |
| 165 | (defface diff-indicator-changed | 163 | (defface spiff-indicator-changed |
| 166 | '((t (:weight bold :extend t))) | 164 | '((t (:weight bold :extend t))) |
| 167 | "") | 165 | "") |
| 168 | (enable-theme 'faces-test-light) | 166 | (enable-theme 'faces-test-light) |
| @@ -173,10 +171,10 @@ | |||
| 173 | 'unspecified)) | 171 | 'unspecified)) |
| 174 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) | 172 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) |
| 175 | nil)) | 173 | nil)) |
| 176 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 174 | (should (equal (face-attribute 'spiff-changed-face :extend) t)) |
| 177 | (should (equal (face-attribute 'diff-added :extend) t)) | 175 | (should (equal (face-attribute 'spiff-added :extend) t)) |
| 178 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 176 | (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) |
| 179 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) | 177 | (should (equal (face-attribute 'spiff-indicator-changed :extend) t)) |
| 180 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 178 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 181 | (frame-set-background-mode (selected-frame) 'dark) | 179 | (frame-set-background-mode (selected-frame) 'dark) |
| 182 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) | 180 | (should (equal (face-attribute 'faces--test-inherit-extend :extend) |
| @@ -186,10 +184,10 @@ | |||
| 186 | 'unspecified)) | 184 | 'unspecified)) |
| 187 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) | 185 | (should (equal (face-attribute 'faces--test-inherit-no-extend :extend nil t) |
| 188 | nil)) | 186 | nil)) |
| 189 | (should (equal (face-attribute 'diff-changed-face :extend) t)) | 187 | (should (equal (face-attribute 'spiff-changed-face :extend) t)) |
| 190 | (should (equal (face-attribute 'diff-added :extend) t)) | 188 | (should (equal (face-attribute 'spiff-added :extend) t)) |
| 191 | (should (equal (face-attribute 'diff-file-header-face :extend) nil)) | 189 | (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) |
| 192 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) | 190 | (should (equal (face-attribute 'spiff-indicator-changed :extend) t)) |
| 193 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 191 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 194 | (or noninteractive | 192 | (or noninteractive |
| 195 | (let ((fr (make-frame))) | 193 | (let ((fr (make-frame))) |
| @@ -203,21 +201,21 @@ | |||
| 203 | (should (equal (face-attribute 'faces--test-inherit-no-extend | 201 | (should (equal (face-attribute 'faces--test-inherit-no-extend |
| 204 | :extend fr t) | 202 | :extend fr t) |
| 205 | nil)) | 203 | nil)) |
| 206 | (should (equal (face-attribute 'diff-changed-face :extend fr) t)) | 204 | (should (equal (face-attribute 'spiff-changed-face :extend fr) t)) |
| 207 | (should (equal (face-attribute 'diff-added :extend fr) t)) | 205 | (should (equal (face-attribute 'spiff-added :extend fr) t)) |
| 208 | (should (equal (face-attribute 'diff-file-header-face :extend fr) nil)) | 206 | (should (equal (face-attribute 'spiff-file-header-face :extend fr) nil)) |
| 209 | (should (equal (face-attribute 'diff-indicator-changed :extend fr) t)) | 207 | (should (equal (face-attribute 'spiff-indicator-changed :extend fr) t)) |
| 210 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) | 208 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) t)) |
| 211 | )) | 209 | )) |
| 212 | (disable-theme 'faces-test-light) | 210 | (disable-theme 'faces-test-light) |
| 213 | (should (equal (face-attribute 'diff-indicator-changed :extend) t)) | 211 | (should (equal (face-attribute 'spiff-indicator-changed :extend) t)) |
| 214 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) | 212 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) |
| 215 | (or noninteractive | 213 | (or noninteractive |
| 216 | (let ((fr (make-frame))) | 214 | (let ((fr (make-frame))) |
| 217 | (should (equal (face-attribute 'diff-changed-face :extend fr) t)) | 215 | (should (equal (face-attribute 'spiff-changed-face :extend fr) t)) |
| 218 | (should (equal (face-attribute 'diff-added :extend fr) 'unspecified)) | 216 | (should (equal (face-attribute 'spiff-added :extend fr) 'unspecified)) |
| 219 | (should (equal (face-attribute 'diff-file-header-face :extend fr) nil)) | 217 | (should (equal (face-attribute 'spiff-file-header-face :extend fr) nil)) |
| 220 | (should (equal (face-attribute 'diff-indicator-changed :extend fr) t)) | 218 | (should (equal (face-attribute 'spiff-indicator-changed :extend fr) t)) |
| 221 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) | 219 | (should (equal (face-attribute 'faces--test-face3 :extend nil t) 'unspecified)) |
| 222 | )) | 220 | )) |
| 223 | ) | 221 | ) |