;; Test that the remote file was added to the list of files
;; to remove later.
(should dnd-last-dragged-remote-file)
+ ;; Make sure the appropriate hook is added so the remote
+ ;; files are removed when Emacs exits.
+ (should (memq #'dnd-remove-last-dragged-remote-file
+ kill-emacs-hook))
;; Test that the remote file was removed.
(should (progn
(dnd-begin-file-drag normal-temp-file)
(not dnd-last-dragged-remote-file)))
+ ;; Make sure the remote file removal hook was deleted.
+ (should-not (memq #'dnd-remove-last-dragged-remote-file
+ kill-emacs-hook))
;; Test that links to remote files can't be created.
(should-error (dnd-begin-file-drag remote-temp-file nil 'link))
;; Test dragging a file with a multibyte filename.
;; Test that the remote file produced was added to the list
;; of files to remove upon the next call.
(should dnd-last-dragged-remote-file)
+ ;; Make sure the appropriate hook is added so the remote
+ ;; files are removed when Emacs exits.
+ (should (memq #'dnd-remove-last-dragged-remote-file
+ kill-emacs-hook))
;; Two local files at the same time.
(should (eq (dnd-begin-drag-files (list normal-temp-file
normal-temp-file-1))
'copy))
;; Test that the remote files were removed.
(should-not dnd-last-dragged-remote-file)
+ ;; And so was the hook.
+ (should-not (memq #'dnd-remove-last-dragged-remote-file
+ kill-emacs-hook))
;; Test the selection data is correct.
(let ((uri-list-data (cdr (dnd-tests-verify-selection-data 'text/uri-list)))
(username-data (dnd-tests-verify-selection-data 'text/x-xdnd-username))
;; Make sure exactly two valid remote files
;; were downloaded.
(eq (length dnd-last-dragged-remote-file) 2)))
+ ;; Make sure the appropriate hook is added so the remote
+ ;; files are removed when Emacs exits.
+ (should (memq #'dnd-remove-last-dragged-remote-file
+ kill-emacs-hook))
;; Make sure links can't be created to remote files.
(should-error (dnd-begin-drag-files (list normal-temp-file
remote-temp-file
normal-temp-file-1)
nil 'link)
'link))
+ ;; Make sure the remote file removal hook was deleted.
+ (should-not (memq #'dnd-remove-last-dragged-remote-file
+ kill-emacs-hook))
;; Make sure you can't drag an empty list of files.
(should-error (dnd-begin-drag-files nil))
;; And when all remote files are inaccessible.