summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2017-06-14 00:30:20 +0530
committerArun Isaac2017-06-14 00:32:55 +0530
commitb18ba26ea2bf06f084c1b3afe4a34405eda9d703 (patch)
tree53a6b4a205a3bf7b28af0525d97fe5fa5acbda66
parent6c695c4b48995a159595da0002afeaeb3862ab00 (diff)
downloadexiftool.el-b18ba26ea2bf06f084c1b3afe4a34405eda9d703.tar.gz
exiftool.el-b18ba26ea2bf06f084c1b3afe4a34405eda9d703.tar.lz
exiftool.el-b18ba26ea2bf06f084c1b3afe4a34405eda9d703.zip
Test copying only specific tags.
* tests/exiftool-tests.el (copy-test): Rename to `copy-all-test'. (copy-some-test): New test.
-rw-r--r--tests/exiftool-tests.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/exiftool-tests.el b/tests/exiftool-tests.el
index 9d9db03..8a9b803 100644
--- a/tests/exiftool-tests.el
+++ b/tests/exiftool-tests.el
@@ -34,6 +34,7 @@
("Rights" . "bar")))
(require 'exiftool)
+(require 'cl-lib)
(require 'ert)
(defmacro with-temp-test-file (test-file temp-file &rest body)
@@ -60,7 +61,7 @@
(should (equal (car (exiftool-read temp-file "Marked"))
delete-pair)))))
-(ert-deftest copy-test ()
+(ert-deftest copy-all-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)
@@ -69,6 +70,18 @@
(should (equal (apply 'exiftool-read temp-1 tags)
(apply 'exiftool-read temp-2 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)))
+ (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)))
+ (equal (apply 'exiftool-read temp-1 some-tags)
+ (apply 'exiftool-read temp-2 some-tags))))))))
+
(provide 'exiftool-tests)
;;; exiftool-tests.el ends here