summaryrefslogtreecommitdiff
path: root/tests/exiftool-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exiftool-tests.el')
-rw-r--r--tests/exiftool-tests.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/exiftool-tests.el b/tests/exiftool-tests.el
index ecb4f15..6f14ffe 100644
--- a/tests/exiftool-tests.el
+++ b/tests/exiftool-tests.el
@@ -37,6 +37,12 @@
("Subject" . "foo:bar")
("Description" . "foo: bar")))
+(defvar exiftool-tests--tags
+ (mapcar (cl-function
+ (lambda ((tag . value))
+ tag))
+ exiftool-tests--tag-value))
+
(require 'exiftool)
(require 'cl-lib)
(require 'ert)
@@ -53,7 +59,7 @@
(ert-deftest read-write-test ()
(with-temp-test-file "test1.png" temp-file
(apply 'exiftool-write temp-file exiftool-tests--tag-value)
- (should (equal (apply 'exiftool-read temp-file (mapcar 'car exiftool-tests--tag-value))
+ (should (equal (apply 'exiftool-read temp-file exiftool-tests--tags)
exiftool-tests--tag-value))))
(ert-deftest delete-test ()
@@ -70,19 +76,17 @@
(with-temp-test-file "test2.png" temp-2
(apply 'exiftool-write temp-1 exiftool-tests--tag-value)
(exiftool-copy temp-1 temp-2)
- (let ((tags (mapcar 'car exiftool-tests--tag-value)))
- (should (equal (apply 'exiftool-read temp-1 tags)
- (apply 'exiftool-read temp-2 tags)))))))
+ (should (equal (apply 'exiftool-read temp-1 exiftool-tests--tags)
+ (apply 'exiftool-read temp-2 exiftool-tests--tags))))))
(ert-deftest copy-some-test ()
(with-temp-test-file "test1.png" temp-1
(with-temp-test-file "test2.png" temp-2
(apply 'exiftool-write temp-1 exiftool-tests--tag-value)
- (let* ((all-tags (mapcar 'car exiftool-tests--tag-value))
- (some-tags (cl-subseq all-tags 2)))
+ (let ((some-tags (cl-subseq exiftool-tests--tags 2)))
(apply 'exiftool-copy temp-1 temp-2 some-tags)
- (should (and (not (equal (apply 'exiftool-read temp-1 all-tags)
- (apply 'exiftool-read temp-2 all-tags)))
+ (should (and (not (equal (apply 'exiftool-read temp-1 exiftool-tests--tags)
+ (apply 'exiftool-read temp-2 exiftool-tests--tags)))
(equal (apply 'exiftool-read temp-1 some-tags)
(apply 'exiftool-read temp-2 some-tags))))))))