[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select ec5a249 1/7: Needlessly refactor tests
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select ec5a249 1/7: Needlessly refactor tests for clarity |
Date: |
Mon, 24 Apr 2017 21:17:11 -0400 (EDT) |
branch: feature/gnus-select
commit ec5a24989fd1c91f0666411a78d04e7436292107
Author: Lars Ingebrigtsen <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Needlessly refactor tests for clarity
---
test/manual/image-size-tests.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/test/manual/image-size-tests.el b/test/manual/image-size-tests.el
index 972361a..301352e 100644
--- a/test/manual/image-size-tests.el
+++ b/test/manual/image-size-tests.el
@@ -22,9 +22,9 @@
;;; Code:
-(defmacro im-should (form)
- `(unless ,form
- (error "%s didn't succeed" ',form)))
+(defmacro im-should (width height &rest props)
+ `(unless (im-compare (im-image ,@props) ,width ,height)
+ (error "%s didn't succeed" ',props)))
(defun im-image (&rest props)
(let ((image-scaling-factor 1))
@@ -42,23 +42,23 @@
(unless (imagemagick-types)
(error "This only makes sense if ImageMagick is installed"))
;; Default sizes.
- (im-should (im-compare (im-image) 200 100))
+ (im-should 200 100)
;; Changing one dimension changes the other.
- (im-should (im-compare (im-image :width 100) 100 50))
- (im-should (im-compare (im-image :height 50) 100 50))
+ (im-should 100 50 :width 100)
+ (im-should 100 50 :height 50)
;; The same with :max-width etc.
- (im-should (im-compare (im-image :max-width 100) 100 50))
- (im-should (im-compare (im-image :max-height 50) 100 50))
+ (im-should 100 50 :max-width 100)
+ (im-should 100 50 :max-height 50)
;; :width wins over :max-width etc
- (im-should (im-compare (im-image :width 300 :max-width 100) 300 150))
- (im-should (im-compare (im-image :height 200 :max-height 100) 400 200))
+ (im-should 300 150 :width 300 :max-width 100)
+ (im-should 400 200 :height 200 :max-height 100)
;; Specifying both width and height is fine.
- (im-should (im-compare (im-image :width 300 :height 50) 300 50))
+ (im-should 300 50 :width 300 :height 50)
;; A too-large :max-width (etc) has no effect.
- (im-should (im-compare (im-image :max-width 300) 200 100))
- (im-should (im-compare (im-image :max-height 300) 200 100))
+ (im-should 200 100 :max-width 300)
+ (im-should 200 100 :max-height 300)
;; Both max-width/height.
- (im-should (im-compare (im-image :max-width 100 :max-height 75) 100 50))
- (im-should (im-compare (im-image :max-width 100 :max-height 25) 50 25)))
+ (im-should 100 50 :max-width 100 :max-height 75)
+ (im-should 50 25 :max-width 100 :max-height 25))
;;; image-size-tests.el ends here
- [Emacs-diffs] feature/gnus-select updated (6ff9a4f -> e7fd724), Andrew G Cohen, 2017/04/24
- [Emacs-diffs] feature/gnus-select 66d1ec0 6/7: Remove s_client usage from tls.el, Andrew G Cohen, 2017/04/24
- [Emacs-diffs] feature/gnus-select bcf49f6 5/7: Further robustify cedet bootstrap to loaddefs not yet built, Andrew G Cohen, 2017/04/24
- [Emacs-diffs] feature/gnus-select e528a75 4/7: Fix XBM colour rendering in NS port (bug#22060), Andrew G Cohen, 2017/04/24
- [Emacs-diffs] feature/gnus-select 5d21c62 3/7: Add support for IRCv3 message tags., Andrew G Cohen, 2017/04/24
- [Emacs-diffs] feature/gnus-select e7fd724 7/7: Don't advertise s_client in tls.el docs, Andrew G Cohen, 2017/04/24
- [Emacs-diffs] feature/gnus-select ec5a249 1/7: Needlessly refactor tests for clarity,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 7bbc43e 2/7: Add image sizing tests for an image that's narrow, Andrew G Cohen, 2017/04/24