diff options
| author | Paul Eggert | 2017-09-17 12:56:00 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-09-17 13:06:54 -0700 |
| commit | 37b5e661d298cbfe51422cd515b6696a1cdaa868 (patch) | |
| tree | bd37e0f404e7061640f89de39b33968d8df29076 /test | |
| parent | 6bbbc38b3421723521f7cdd4fd617a4fc889aceb (diff) | |
| download | emacs-37b5e661d298cbfe51422cd515b6696a1cdaa868.tar.gz emacs-37b5e661d298cbfe51422cd515b6696a1cdaa868.zip | |
Fix recently-introduced copy-directory bug
Problem reported by Andrew Christianson (Bug#28451):
* lisp/files.el (copy-directory): If COPY-CONTENTS, make the
destination directory if it does not exist, even if it is a
directory name. Simplify, and omit unnecessary test for an
already-existing non-directory target, since make-directory
diagnoses that for us now.
* test/lisp/files-tests.el (files-tests--copy-directory):
Test for this bug.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/files-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index ef216c3f34a..3117ea697ec 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -393,5 +393,16 @@ name (Bug#28412)." | |||
| 393 | (should (null (save-buffer))) | 393 | (should (null (save-buffer))) |
| 394 | (should (eq (buffer-size) 1)))))) | 394 | (should (eq (buffer-size) 1)))))) |
| 395 | 395 | ||
| 396 | (ert-deftest files-tests--copy-directory () | ||
| 397 | (let* ((dir (make-temp-file "files-mkdir-test" t)) | ||
| 398 | (dirname (file-name-as-directory dir)) | ||
| 399 | (source (concat dirname "source")) | ||
| 400 | (dest (concat dirname "dest/new/directory/")) | ||
| 401 | (file (concat (file-name-as-directory source) "file"))) | ||
| 402 | (make-directory source) | ||
| 403 | (write-region "" nil file) | ||
| 404 | (copy-directory source dest t t t) | ||
| 405 | (should (file-exists-p (concat dest "file"))))) | ||
| 406 | |||
| 396 | (provide 'files-tests) | 407 | (provide 'files-tests) |
| 397 | ;;; files-tests.el ends here | 408 | ;;; files-tests.el ends here |