diff options
| author | Lars Ingebrigtsen | 2017-04-24 07:47:09 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2017-04-24 07:47:09 +0200 |
| commit | fe304efa5155cd6a5c20a0731475a0ad6d087c4c (patch) | |
| tree | 402b81045ab28f9fa15c4443da78e045d7828399 | |
| parent | a1f93c1dfa53dbe007faa09ab0c6e913e86e3ffe (diff) | |
| download | emacs-fe304efa5155cd6a5c20a0731475a0ad6d087c4c.tar.gz emacs-fe304efa5155cd6a5c20a0731475a0ad6d087c4c.zip | |
Needlessly refactor tests for clarity
| -rw-r--r-- | test/manual/image-size-tests.el | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/manual/image-size-tests.el b/test/manual/image-size-tests.el index 972361aa63a..301352eddb0 100644 --- a/test/manual/image-size-tests.el +++ b/test/manual/image-size-tests.el | |||
| @@ -22,9 +22,9 @@ | |||
| 22 | 22 | ||
| 23 | ;;; Code: | 23 | ;;; Code: |
| 24 | 24 | ||
| 25 | (defmacro im-should (form) | 25 | (defmacro im-should (width height &rest props) |
| 26 | `(unless ,form | 26 | `(unless (im-compare (im-image ,@props) ,width ,height) |
| 27 | (error "%s didn't succeed" ',form))) | 27 | (error "%s didn't succeed" ',props))) |
| 28 | 28 | ||
| 29 | (defun im-image (&rest props) | 29 | (defun im-image (&rest props) |
| 30 | (let ((image-scaling-factor 1)) | 30 | (let ((image-scaling-factor 1)) |
| @@ -42,23 +42,23 @@ | |||
| 42 | (unless (imagemagick-types) | 42 | (unless (imagemagick-types) |
| 43 | (error "This only makes sense if ImageMagick is installed")) | 43 | (error "This only makes sense if ImageMagick is installed")) |
| 44 | ;; Default sizes. | 44 | ;; Default sizes. |
| 45 | (im-should (im-compare (im-image) 200 100)) | 45 | (im-should 200 100) |
| 46 | ;; Changing one dimension changes the other. | 46 | ;; Changing one dimension changes the other. |
| 47 | (im-should (im-compare (im-image :width 100) 100 50)) | 47 | (im-should 100 50 :width 100) |
| 48 | (im-should (im-compare (im-image :height 50) 100 50)) | 48 | (im-should 100 50 :height 50) |
| 49 | ;; The same with :max-width etc. | 49 | ;; The same with :max-width etc. |
| 50 | (im-should (im-compare (im-image :max-width 100) 100 50)) | 50 | (im-should 100 50 :max-width 100) |
| 51 | (im-should (im-compare (im-image :max-height 50) 100 50)) | 51 | (im-should 100 50 :max-height 50) |
| 52 | ;; :width wins over :max-width etc | 52 | ;; :width wins over :max-width etc |
| 53 | (im-should (im-compare (im-image :width 300 :max-width 100) 300 150)) | 53 | (im-should 300 150 :width 300 :max-width 100) |
| 54 | (im-should (im-compare (im-image :height 200 :max-height 100) 400 200)) | 54 | (im-should 400 200 :height 200 :max-height 100) |
| 55 | ;; Specifying both width and height is fine. | 55 | ;; Specifying both width and height is fine. |
| 56 | (im-should (im-compare (im-image :width 300 :height 50) 300 50)) | 56 | (im-should 300 50 :width 300 :height 50) |
| 57 | ;; A too-large :max-width (etc) has no effect. | 57 | ;; A too-large :max-width (etc) has no effect. |
| 58 | (im-should (im-compare (im-image :max-width 300) 200 100)) | 58 | (im-should 200 100 :max-width 300) |
| 59 | (im-should (im-compare (im-image :max-height 300) 200 100)) | 59 | (im-should 200 100 :max-height 300) |
| 60 | ;; Both max-width/height. | 60 | ;; Both max-width/height. |
| 61 | (im-should (im-compare (im-image :max-width 100 :max-height 75) 100 50)) | 61 | (im-should 100 50 :max-width 100 :max-height 75) |
| 62 | (im-should (im-compare (im-image :max-width 100 :max-height 25) 50 25))) | 62 | (im-should 50 25 :max-width 100 :max-height 25)) |
| 63 | 63 | ||
| 64 | ;;; image-size-tests.el ends here | 64 | ;;; image-size-tests.el ends here |