|
51 | 51 | (theme-looper--disable-all-themes)
|
52 | 52 | (should (equal custom-enabled-themes
|
53 | 53 | '())))
|
54 |
| - (load-theme current-theme |
55 |
| - t)))) |
| 54 | + (when current-theme |
| 55 | + (load-theme current-theme t))))) |
56 | 56 |
|
57 | 57 | (ert-deftest tl-test:getting-theme-indices ()
|
58 | 58 | (let ((current-theme (car custom-enabled-themes)))
|
|
86 | 86 | 'wombat)))
|
87 | 87 | (setq theme-looper--favorite-themes
|
88 | 88 | (custom-available-themes))
|
89 |
| - (load-theme current-theme |
90 |
| - t)))) |
| 89 | + (when current-theme |
| 90 | + (load-theme current-theme t))))) |
91 | 91 |
|
92 | 92 | (ert-deftest tl-test:setting-next-theme ()
|
93 | 93 | (let ((current-theme (car custom-enabled-themes)))
|
|
113 | 113 | '(wombat))))
|
114 | 114 | (setq theme-looper--favorite-themes
|
115 | 115 | (custom-available-themes))
|
116 |
| - (load-theme current-theme |
117 |
| - t)))) |
| 116 | + (when current-theme |
| 117 | + (load-theme current-theme |
| 118 | + t))))) |
118 | 119 |
|
119 | 120 | (ert-deftest tl-test:adding-customization ()
|
120 | 121 | (let ((current-theme (car custom-enabled-themes))
|
121 |
| - (current-face-height (face-attribute 'default |
122 |
| - :height))) |
| 122 | + (current-face-background (face-background 'default))) |
123 | 123 | (unwind-protect
|
124 | 124 | (progn
|
125 |
| - (message (concatenate 'string |
126 |
| - "current-face-height: " |
127 |
| - (number-to-string current-face-height))) |
128 |
| - (theme-looper-set-favorite-themes (list 'wombat |
| 125 | + (set-face-background 'default "red") |
| 126 | + (message (concat "current face-background: red")) |
| 127 | + (theme-looper-set-favorite-themes (list 'wombat |
129 | 128 | 'tango-dark
|
130 | 129 | 'wheatgrass))
|
131 | 130 | ;;Should apply customizations when specified
|
132 |
| - (load-theme 'tango |
| 131 | + (load-theme 'tango |
133 | 132 | t)
|
134 |
| - (theme-looper-set-post-switch-script (lambda () |
135 |
| - (set-face-attribute 'default nil |
136 |
| - :height 120))) |
| 133 | + (add-hook 'theme-looper-post-switch-hook |
| 134 | + (lambda () |
| 135 | + (set-face-background 'default "green"))) |
137 | 136 | (theme-looper-enable-next-theme)
|
138 |
| - (message (concatenate 'string |
139 |
| - "found face-height: " |
140 |
| - (number-to-string (face-attribute 'default :height)))) |
141 |
| - (should (< (abs (- (face-attribute 'default :height) |
142 |
| - 120)) |
143 |
| - 2))) |
| 137 | + (message (concat "found face-background: " |
| 138 | + (face-background 'default))) |
| 139 | + (should (equal (face-background 'default) "green"))) |
144 | 140 | (setq theme-looper--favorite-themes
|
145 | 141 | (custom-available-themes))
|
146 |
| - (load-theme current-theme |
147 |
| - t) |
148 |
| - (set-face-attribute 'default nil |
149 |
| - :height current-face-height)))) |
| 142 | + (setq theme-looper-post-switch-hook nil) |
| 143 | + (when current-theme |
| 144 | + (load-theme current-theme t)) |
| 145 | + (set-face-background 'default current-face-background)))) |
150 | 146 |
|
151 | 147 | (ert-deftest tl-test:emacs-defaults ()
|
152 | 148 | (let ((current-theme (car custom-enabled-themes)))
|
|
0 commit comments