aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2019-07-12 15:10:57 +0200
committerMichael Albinus2019-07-12 15:10:57 +0200
commit955db220053778bd1e47ff9daf87896b7fd52a67 (patch)
treed7e7b138ee69930467f6eb40e6d211c3521c2ac3 /test
parent9f76913184c900534fa17311ff5b1af747ff6264 (diff)
downloademacs-955db220053778bd1e47ff9daf87896b7fd52a67.tar.gz
emacs-955db220053778bd1e47ff9daf87896b7fd52a67.zip
Check directory in Tramp's {copy,rename}-file
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file) (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): * lisp/net/tramp-smb.el (tramp-smb-handle-copy-file) (tramp-smb-handle-rename-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file): Check, that NEWNAME is not a directory given as file name. * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Extend tests.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 77b2c263ff8..a12e41a8822 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2394,7 +2394,10 @@ This checks also `file-name-as-directory', `file-name-directory',
2394 (when (and (tramp--test-expensive-test) (tramp--test-emacs26-p)) 2394 (when (and (tramp--test-expensive-test) (tramp--test-emacs26-p))
2395 (should-error 2395 (should-error
2396 (copy-file source target) 2396 (copy-file source target)
2397 :type 'file-already-exists)) 2397 :type 'file-already-exists)
2398 (should-error
2399 (copy-file source target 'ok)
2400 :type 'file-error))
2398 (copy-file source (file-name-as-directory target)) 2401 (copy-file source (file-name-as-directory target))
2399 (should 2402 (should
2400 (file-exists-p 2403 (file-exists-p
@@ -2508,7 +2511,10 @@ This checks also `file-name-as-directory', `file-name-directory',
2508 (when (and (tramp--test-expensive-test) (tramp--test-emacs26-p)) 2511 (when (and (tramp--test-expensive-test) (tramp--test-emacs26-p))
2509 (should-error 2512 (should-error
2510 (rename-file source target) 2513 (rename-file source target)
2511 :type 'file-already-exists)) 2514 :type 'file-already-exists)
2515 (should-error
2516 (rename-file source target 'ok)
2517 :type 'file-error))
2512 (rename-file source (file-name-as-directory target)) 2518 (rename-file source (file-name-as-directory target))
2513 (should-not (file-exists-p source)) 2519 (should-not (file-exists-p source))
2514 (should 2520 (should