From b18ba26ea2bf06f084c1b3afe4a34405eda9d703 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 14 Jun 2017 00:30:20 +0530 Subject: Test copying only specific tags. * tests/exiftool-tests.el (copy-test): Rename to `copy-all-test'. (copy-some-test): New test. --- tests/exiftool-tests.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3