(tramp-inline-compress-start-size 2))
(delete-file tmp-name2)
(should (setq tmp-name2 (file-local-copy tmp-name1)))))
+
+ ;; Cleanup.
(ignore-errors
(delete-file tmp-name1)
(delete-file tmp-name2)))))
;; Replace.
(insert-file-contents tmp-name nil nil nil 'replace)
(should (string-equal (buffer-string) "foo"))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test10-write-region ()
(with-temp-buffer
(insert-file-contents tmp-name)
(should (string-equal (buffer-string) "34"))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test11-copy-file ()
(should
(file-exists-p
(expand-file-name (file-name-nondirectory tmp-name1) tmp-name3))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-file tmp-name2))
(ignore-errors (delete-directory tmp-name3 'recursive)))
(should
(file-exists-p
(expand-file-name (file-name-nondirectory tmp-name1) tmp-name5))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-file tmp-name4))
(ignore-errors (delete-directory tmp-name5 'recursive)))
(should
(file-exists-p
(expand-file-name (file-name-nondirectory tmp-name4) tmp-name3))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-file tmp-name4))
(ignore-errors (delete-directory tmp-name3 'recursive)))))
(should
(file-exists-p
(expand-file-name (file-name-nondirectory tmp-name1) tmp-name3))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-file tmp-name2))
(ignore-errors (delete-directory tmp-name3 'recursive)))
(should
(file-exists-p
(expand-file-name (file-name-nondirectory tmp-name1) tmp-name5))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-file tmp-name4))
(ignore-errors (delete-directory tmp-name5 'recursive)))
(should
(file-exists-p
(expand-file-name (file-name-nondirectory tmp-name4) tmp-name3))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-file tmp-name4))
(ignore-errors (delete-directory tmp-name3 'recursive)))))
(should (file-directory-p (expand-file-name "foo/bar" tmp-name)))
(should
(file-accessible-directory-p (expand-file-name "foo/bar" tmp-name))))
- (ignore-errors (delete-directory tmp-name)))))
+
+ ;; Cleanup.
+ (ignore-errors (delete-directory tmp-name 'recursive)))))
(ert-deftest tramp-test14-delete-directory ()
"Check `delete-directory'."
(copy-directory tmp-name1 tmp-name2)
(should (file-directory-p tmp-name3))
(should (file-exists-p tmp-name6)))
+
+ ;; Cleanup.
(ignore-errors
(delete-directory tmp-name1 'recursive)
(delete-directory tmp-name2 'recursive)))))
(should (equal (directory-files
tmp-name1 'full directory-files-no-dot-files-regexp)
`(,tmp-name2 ,tmp-name3))))
+
+ ;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive)))))
(ert-deftest tramp-test17-insert-directory ()
"\\(total.+[[:digit:]]+\n\\)?"
;; We don't know in which order ".", ".." and "foo" appear.
"\\(.+ \\(\\.?\\.\\|foo\\)\n\\)\\{3\\}")))))
+
+ ;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive)))))
(ert-deftest tramp-test18-file-attributes ()
(setq attr (file-attributes tmp-name1))
(should (eq (car attr) t)))
+ ;; Cleanup.
(ignore-errors (delete-directory tmp-name1)))))
(ert-deftest tramp-test19-directory-files-and-attributes ()
(equal (file-attributes (car elt)) (cdr elt)))))
(setq attr (directory-files-and-attributes tmp-name2 nil "^b"))
(should (equal (mapcar 'car attr) '("bar" "boz"))))
+
+ ;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive)))))
(ert-deftest tramp-test20-file-modes ()
;; A file is always writable for user "root".
(unless (zerop (nth 2 (file-attributes tmp-name)))
(should-not (file-writable-p tmp-name))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test21-file-links ()
(should (file-symlink-p tmp-name2))
;; `tmp-name3' is a local file name.
(should-error (make-symbolic-link tmp-name1 tmp-name3)))
+
+ ;; Cleanup.
(ignore-errors
(delete-file tmp-name1)
(delete-file tmp-name2)))
(should-not (file-symlink-p tmp-name2))
;; `tmp-name3' is a local file name.
(should-error (add-name-to-file tmp-name1 tmp-name3)))
+
+ ;; Cleanup.
(ignore-errors
(delete-file tmp-name1)
(delete-file tmp-name2)))
;; `tmp-name3' does not exist.
(should (file-newer-than-file-p tmp-name2 tmp-name3))
(should-not (file-newer-than-file-p tmp-name3 tmp-name1))))
+
+ ;; Cleanup.
(ignore-errors
(delete-file tmp-name1)
(delete-file tmp-name2)))))
(set-visited-file-modtime '(0 1))
(should (verify-visited-file-modtime))
(should (equal (visited-file-modtime) '(0 1 0 0)))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test24-file-name-completion ()
(should
(equal (sort (file-name-all-completions "b" tmp-name) 'string-lessp)
'("bold" "boz/"))))
+
+ ;; Cleanup.
(ignore-errors (delete-directory tmp-name 'recursive)))))
(ert-deftest tramp-test25-load ()
;(should-error (load tmp-name nil 'nomessage 'nosuffix 'must-suffix))
(load tmp-name nil 'nomessage 'nosuffix)
(should (featurep 'tramp-test-load)))
+
+ ;; Cleanup.
(ignore-errors
(and (featurep 'tramp-test-load) (unload-feature 'tramp-test-load))
(delete-file tmp-name)))))
;; A non-nil DISPLAY must not raise the buffer.
(should-not (get-buffer-window (current-buffer) t))))
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test27-start-file-process ()
(while (< (- (point-max) (point-min)) (length "foo"))
(accept-process-output proc 1)))
(should (string-equal (buffer-string) "foo")))
+
+ ;; Cleanup.
(ignore-errors (delete-process proc)))
(unwind-protect
(while (< (- (point-max) (point-min)) (length "foo"))
(accept-process-output proc 1)))
(should (string-equal (buffer-string) "foo")))
+
+ ;; Cleanup.
(ignore-errors
(delete-process proc)
(delete-file tmp-name)))
(while (< (- (point-max) (point-min)) (length "foo"))
(accept-process-output proc 1)))
(should (string-equal (buffer-string) "foo")))
+
+ ;; Cleanup.
(ignore-errors (delete-process proc)))))
(ert-deftest tramp-test28-shell-command ()
(should
(string-equal
(format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))
(unwind-protect
(should
(string-equal
(format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))
(unwind-protect
(should
(string-equal
(format "%s\n" (file-name-nondirectory tmp-name)) (buffer-string))))
+
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name)))))
(ert-deftest tramp-test29-vc-registered ()
(list (file-name-nondirectory tmp-name2)))))))
(should (vc-registered tmp-name2)))
- (ignore-errors (delete-directory tmp-name1 'recursive)))))
+ ;; Cleanup.
+ (ignore-errors (delete-directory tmp-name1 'recursive)))))
(ert-deftest tramp-test30-make-auto-save-file-name ()
"Check `make-auto-save-file-name'."
tmp-name2)))
(should (file-directory-p tmp-name2)))))
+ ;; Cleanup.
(ignore-errors (delete-file tmp-name1))
(ignore-errors (delete-directory tmp-name2 'recursive)))))
(delete-directory file1)
(should-not (file-exists-p file1)))))
+ ;; Cleanup.
(ignore-errors (delete-directory tmp-name1 'recursive))
(ignore-errors (delete-directory tmp-name2 'recursive)))))
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "perl" nil)
(tramp--test-special-characters))
+
;; Reset suppressed properties.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "perl" 'undef))))
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "stat" nil)
(tramp--test-special-characters))
+
;; Reset suppressed properties.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "stat" 'undef))))
(tramp-set-connection-property v "stat" nil)
(tramp-set-connection-property v "perl" nil)
(tramp--test-special-characters))
+
;; Reset suppressed properties.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "stat" 'undef)
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "perl" nil)
(tramp--test-utf8))
+
;; Reset suppressed properties.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "perl" 'undef))))
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "stat" nil)
(tramp--test-utf8))
+
;; Reset suppressed properties.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "stat" 'undef))))
(tramp-set-connection-property v "stat" nil)
(tramp-set-connection-property v "perl" nil)
(tramp--test-utf8))
+
;; Reset suppressed properties.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(tramp-set-connection-property v "stat" 'undef)