emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8548ad2: Add three new tests for image.el


From: Stefan Kangas
Subject: master 8548ad2: Add three new tests for image.el
Date: Sun, 14 Mar 2021 21:04:40 -0400 (EDT)

branch: master
commit 8548ad2cb3f0eff766cc87d0db78a09972c72acc
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Add three new tests for image.el
    
    * test/lisp/image-tests.el (image-find-image)
    (image-type-from-file-name, image-type/from-filename): New tests.
---
 test/lisp/image-tests.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index ab7585c..bb42ffa 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -48,6 +48,17 @@
     (setf (image-property image :width) nil)
     (should (equal image '(image)))))
 
+(ert-deftest image-find-image ()
+  (find-image '((:type xpm :file "undo.xpm")))
+  (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center))))
+
+(ert-deftest image-type-from-file-name ()
+  (should (eq (image-type-from-file-name "foo.jpg") 'jpeg))
+  (should (eq (image-type-from-file-name "foo.png") 'png)))
+
+(ert-deftest image-type/from-filename ()
+  (should (eq (image-type "foo.jpg") 'jpeg)))
+
 (ert-deftest image-type-from-file-header-test ()
   "Test image-type-from-file-header."
   (should (eq (if (image-type-available-p 'svg) 'svg)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]