diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/image-tests.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index 5a5b8ea1f71..01c81e3022f 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | (require 'ert) | 22 | (require 'ert) |
| 23 | (require 'image) | 23 | (require 'image) |
| 24 | (eval-when-compile | ||
| 25 | (require 'cl-lib)) | ||
| 24 | 26 | ||
| 25 | (defconst image-tests--emacs-images-directory | 27 | (defconst image-tests--emacs-images-directory |
| 26 | (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY")) | 28 | (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY")) |
| @@ -53,4 +55,25 @@ | |||
| 53 | (expand-file-name "splash.svg" | 55 | (expand-file-name "splash.svg" |
| 54 | image-tests--emacs-images-directory))))) | 56 | image-tests--emacs-images-directory))))) |
| 55 | 57 | ||
| 58 | (ert-deftest image-rotate () | ||
| 59 | "Test `image-rotate'." | ||
| 60 | (cl-letf* ((image (list 'image)) | ||
| 61 | ((symbol-function 'image--get-imagemagick-and-warn) | ||
| 62 | (lambda () image))) | ||
| 63 | (let ((current-prefix-arg '(4))) | ||
| 64 | (call-interactively #'image-rotate)) | ||
| 65 | (should (equal image '(image :rotation 270.0))) | ||
| 66 | (call-interactively #'image-rotate) | ||
| 67 | (should (equal image '(image :rotation 0.0))) | ||
| 68 | (image-rotate) | ||
| 69 | (should (equal image '(image :rotation 90.0))) | ||
| 70 | (image-rotate 0) | ||
| 71 | (should (equal image '(image :rotation 90.0))) | ||
| 72 | (image-rotate 1) | ||
| 73 | (should (equal image '(image :rotation 91.0))) | ||
| 74 | (image-rotate 1234.5) | ||
| 75 | (should (equal image '(image :rotation 245.5))) | ||
| 76 | (image-rotate -154.5) | ||
| 77 | (should (equal image '(image :rotation 91.0))))) | ||
| 78 | |||
| 56 | ;;; image-tests.el ends here | 79 | ;;; image-tests.el ends here |