diff options
| author | Stefan Kangas | 2022-09-18 11:48:24 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-09-26 17:41:09 +0200 |
| commit | 35d5ad713ee05f5cd922f66462df41deed95f7e8 (patch) | |
| tree | 6546c8d79f7921476ecf769720a13dd44b713c9f /test | |
| parent | a386833503430732a5c9bed8dbc5c3073f72b5ab (diff) | |
| download | emacs-35d5ad713ee05f5cd922f66462df41deed95f7e8.tar.gz emacs-35d5ad713ee05f5cd922f66462df41deed95f7e8.zip | |
Rewrite wallpaper.el to use a cl-defstruct
* lisp/image/wallpaper.el
(wallpaper--default-commands): Delete variable.
(wallpaper-setter): New cl-defstruct.
(wallpaper--default-methods-create): New macro.
(wallpaper--default-setters):
(wallpaper--current-setter): New variables.
(wallpaper--find-setter): New defun to pick a wallpaper-setter.
(wallpaper--find-command, wallpaper--find-command-args):
Use 'wallpaper--find-setter'.
(wallpaper-command): Doc fix.
* test/lisp/image/wallpaper-tests.el
(wallpaper--find-command/return-string)
(wallpaper--find-command-args/return-list)
(wallpaper--image-file-regexp/return-string): New tests.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/image/wallpaper-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/image/wallpaper-tests.el b/test/lisp/image/wallpaper-tests.el index 8cd0fe2215e..80d512c9858 100644 --- a/test/lisp/image/wallpaper-tests.el +++ b/test/lisp/image/wallpaper-tests.el | |||
| @@ -23,6 +23,17 @@ | |||
| 23 | (require 'ert-x) | 23 | (require 'ert-x) |
| 24 | (require 'wallpaper) | 24 | (require 'wallpaper) |
| 25 | 25 | ||
| 26 | (ert-deftest wallpaper--find-command/return-string () | ||
| 27 | (should (and (wallpaper--find-command) | ||
| 28 | (stringp (wallpaper--find-command))))) | ||
| 29 | |||
| 30 | (ert-deftest wallpaper--find-command-args/return-list () | ||
| 31 | (should (and (wallpaper--find-command-args) | ||
| 32 | (listp (wallpaper--find-command-args))))) | ||
| 33 | |||
| 34 | (ert-deftest wallpaper--image-file-regexp/return-string () | ||
| 35 | (should (stringp (wallpaper--image-file-regexp)))) | ||
| 36 | |||
| 26 | (ert-deftest wallpaper--get-default-file/empty-gives-nil () | 37 | (ert-deftest wallpaper--get-default-file/empty-gives-nil () |
| 27 | (with-temp-buffer | 38 | (with-temp-buffer |
| 28 | (should-not (wallpaper--get-default-file)))) | 39 | (should-not (wallpaper--get-default-file)))) |