summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/net/tramp-tests.el54
1 files changed, 2 insertions, 52 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 742bdfd9348..8db54979b6d 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -39,7 +39,6 @@
(require 'dired)
(require 'ert)
-(require 'ert-x)
(require 'tramp)
(require 'vc)
(require 'vc-bzr)
@@ -81,9 +80,6 @@
(when (getenv "NIX_STORE")
(add-to-list 'tramp-remote-path 'tramp-own-remote-path))
-(defvar tramp--test-messages nil
- "Captured messages from *Messages* buffer.")
-
(defvar tramp--test-expensive-test
(null
(string-equal (getenv "SELECTOR") "(quote (not (tag :expensive-test)))"))
@@ -1745,77 +1741,31 @@ This checks also `file-name-as-directory', `file-name-directory',
(skip-unless (tramp--test-enabled))
(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
- (let* ((tmp-name (tramp--test-make-temp-name nil quoted))
- (text-quoting-style 'grave)
- (write-region-verbose
- (and (null noninteractive) (boundp 'write-region-verbose)))
- (tramp-message-show-message
- (or tramp-message-show-message write-region-verbose)))
+ (let ((tmp-name (tramp--test-make-temp-name nil quoted)))
(unwind-protect
- (ert-with-message-capture tramp--test-messages
- ;; Write buffer.
- (setq tramp--test-messages "")
+ (progn
(with-temp-buffer
(insert "foo")
(write-region nil nil tmp-name))
- (when write-region-verbose
- (should
- (string-match
- (format "Wrote `%s' (3 characters)" tmp-name)
- tramp--test-messages)))
(with-temp-buffer
(insert-file-contents tmp-name)
(should (string-equal (buffer-string) "foo")))
-
;; Append.
- (setq tramp--test-messages "")
(with-temp-buffer
(insert "bla")
(write-region nil nil tmp-name 'append))
- (when write-region-verbose
- (should
- (string-match
- (format "Added to `%s' (3 characters)" tmp-name)
- tramp--test-messages)))
(with-temp-buffer
(insert-file-contents tmp-name)
(should (string-equal (buffer-string) "foobla")))
-
- (setq tramp--test-messages "")
- (with-temp-buffer
- (insert "baz")
- (write-region nil nil tmp-name 3))
- (when write-region-verbose
- (should
- (string-match
- (format "Updated `%s' (3 characters)" tmp-name)
- tramp--test-messages)))
- (with-temp-buffer
- (insert-file-contents tmp-name)
- (should (string-equal (buffer-string) "foobaz")))
-
;; Write string.
- (setq tramp--test-messages "")
(write-region "foo" nil tmp-name)
- (when write-region-verbose
- (should
- (string-match
- (format "Wrote `%s' (3 characters)" tmp-name)
- tramp--test-messages)))
(with-temp-buffer
(insert-file-contents tmp-name)
(should (string-equal (buffer-string) "foo")))
-
;; Write partly.
- (setq tramp--test-messages "")
(with-temp-buffer
(insert "123456789")
(write-region 3 5 tmp-name))
- (when write-region-verbose
- (should
- (string-match
- (format "Wrote `%s' (2 characters)" tmp-name)
- tramp--test-messages)))
(with-temp-buffer
(insert-file-contents tmp-name)
(should (string-equal (buffer-string) "34"))))