diff options
| author | Paul Eggert | 2017-09-20 11:49:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-09-20 11:50:35 -0700 |
| commit | 047f02f00f602b9aef63ae8938e12f3f0ab481eb (patch) | |
| tree | 05bb7bce7b212be58d92af124224adb8756329ad /test | |
| parent | fbd15836af69b1d156f39664f2512f85278fdb08 (diff) | |
| download | emacs-047f02f00f602b9aef63ae8938e12f3f0ab481eb.tar.gz emacs-047f02f00f602b9aef63ae8938e12f3f0ab481eb.zip | |
Fix new copy-directory bug with empty dirs
Problem reported by Afdam Plaice (Bug#28520) and by Eli Zaretskii
(Bug#28483#34). This is another bug that I introduced in my
recent copy-directory changes.
* lisp/files.el (copy-directory): Work with empty subdirectories, too.
* 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 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index f2a9a321808..285a884b695 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el | |||
| @@ -399,11 +399,16 @@ name (Bug#28412)." | |||
| 399 | (dirname (file-name-as-directory dir)) | 399 | (dirname (file-name-as-directory dir)) |
| 400 | (source (concat dirname "source")) | 400 | (source (concat dirname "source")) |
| 401 | (dest (concat dirname "dest/new/directory/")) | 401 | (dest (concat dirname "dest/new/directory/")) |
| 402 | (file (concat (file-name-as-directory source) "file"))) | 402 | (file (concat (file-name-as-directory source) "file")) |
| 403 | (source2 (concat dirname "source2")) | ||
| 404 | (dest2 (concat dirname "dest/new2"))) | ||
| 403 | (make-directory source) | 405 | (make-directory source) |
| 404 | (write-region "" nil file) | 406 | (write-region "" nil file) |
| 405 | (copy-directory source dest t t t) | 407 | (copy-directory source dest t t t) |
| 406 | (should (file-exists-p (concat dest "file"))) | 408 | (should (file-exists-p (concat dest "file"))) |
| 409 | (make-directory (concat (file-name-as-directory source2) "a") t) | ||
| 410 | (copy-directory source2 dest2) | ||
| 411 | (should (file-directory-p (concat (file-name-as-directory dest2) "a"))) | ||
| 407 | (delete-directory dir 'recursive))) | 412 | (delete-directory dir 'recursive))) |
| 408 | 413 | ||
| 409 | (provide 'files-tests) | 414 | (provide 'files-tests) |