From 3038f1802e53affe96c243a0da11a9dc47e8c34c Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Sat, 6 Nov 2021 18:01:11 -0700 Subject: [PATCH 1/3] ; * test/lisp/net/tramp-tests.el: Rearrange tests to be in order. --- test/lisp/net/tramp-tests.el | 74 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 737e2209cc..3d6ce963ee 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -6999,8 +6999,40 @@ tramp-test44-asynchronous-requests ;; (tramp--test--deftest-direct-async-process tramp-test44-asynchronous-requests ;; "Check parallel direct asynchronous requests." 'unstable) +(ert-deftest tramp-test45-dired-compress-file () + "Check that Tramp (un)compresses normal files." + (skip-unless (tramp--test-enabled)) + (skip-unless (tramp--test-sh-p)) + (let ((default-directory tramp-test-temporary-file-directory) + (tmp-name (tramp--test-make-temp-name))) + (write-region "foo" nil tmp-name) + (dired default-directory) + (dired-revert) + (dired-goto-file tmp-name) + (should-not (dired-compress)) + (should (string= (concat tmp-name ".gz") (dired-get-filename))) + (should-not (dired-compress)) + (should (string= tmp-name (dired-get-filename))) + (delete-file tmp-name))) + +(ert-deftest tramp-test45-dired-compress-dir () + "Check that Tramp (un)compresses directories." + (skip-unless (tramp--test-enabled)) + (skip-unless (tramp--test-sh-p)) + (let ((default-directory tramp-test-temporary-file-directory) + (tmp-name (tramp--test-make-temp-name))) + (make-directory tmp-name) + (dired default-directory) + (dired-revert) + (dired-goto-file tmp-name) + (should-not (dired-compress)) + (should (string= (concat tmp-name ".tar.gz") (dired-get-filename))) + (should-not (dired-compress)) + (should (string= tmp-name (dired-get-filename))) + (delete-directory tmp-name))) + ;; This test is inspired by Bug#29163. -(ert-deftest tramp-test45-auto-load () +(ert-deftest tramp-test46-auto-load () "Check that Tramp autoloads properly." ;; If we use another syntax but `default', Tramp is already loaded ;; due to the `tramp-change-syntax' call. @@ -7025,7 +7057,7 @@ tramp-test45-auto-load (mapconcat #'shell-quote-argument load-path " -L ") (shell-quote-argument code))))))) -(ert-deftest tramp-test45-delay-load () +(ert-deftest tramp-test46-delay-load () "Check that Tramp is loaded lazily, only when needed." ;; The autoloaded Tramp objects are different since Emacs 26.1. We ;; cannot test older Emacsen, therefore. @@ -7058,7 +7090,7 @@ tramp-test45-delay-load (mapconcat #'shell-quote-argument load-path " -L ") (shell-quote-argument (format code tm))))))))) -(ert-deftest tramp-test45-recursive-load () +(ert-deftest tramp-test46-recursive-load () "Check that Tramp does not fail due to recursive load." (skip-unless (tramp--test-enabled)) @@ -7082,7 +7114,7 @@ tramp-test45-recursive-load (mapconcat #'shell-quote-argument load-path " -L ") (shell-quote-argument code)))))))) -(ert-deftest tramp-test45-remote-load-path () +(ert-deftest tramp-test46-remote-load-path () "Check that Tramp autoloads its packages with remote `load-path'." ;; The autoloaded Tramp objects are different since Emacs 26.1. We ;; cannot test older Emacsen, therefore. @@ -7111,7 +7143,7 @@ tramp-test45-remote-load-path (mapconcat #'shell-quote-argument load-path " -L ") (shell-quote-argument code))))))) -(ert-deftest tramp-test46-unload () +(ert-deftest tramp-test47-unload () "Check that Tramp and its subpackages unload completely. Since it unloads Tramp, it shall be the last test to run." :tags '(:expensive-test) @@ -7169,38 +7201,6 @@ tramp-test46-unload (ignore-errors (all-completions "tramp" (symbol-value x))) (ert-fail (format "Hook `%s' still contains Tramp function" x)))))) -(ert-deftest tramp-test44-dired-compress-file () - "Check that Tramp (un)compresses normal files." - (skip-unless (tramp--test-enabled)) - (skip-unless (tramp--test-sh-p)) - (let ((default-directory tramp-test-temporary-file-directory) - (tmp-name (tramp--test-make-temp-name))) - (write-region "foo" nil tmp-name) - (dired default-directory) - (dired-revert) - (dired-goto-file tmp-name) - (should-not (dired-compress)) - (should (string= (concat tmp-name ".gz") (dired-get-filename))) - (should-not (dired-compress)) - (should (string= tmp-name (dired-get-filename))) - (delete-file tmp-name))) - -(ert-deftest tramp-test44-dired-compress-dir () - "Check that Tramp (un)compresses directories." - (skip-unless (tramp--test-enabled)) - (skip-unless (tramp--test-sh-p)) - (let ((default-directory tramp-test-temporary-file-directory) - (tmp-name (tramp--test-make-temp-name))) - (make-directory tmp-name) - (dired default-directory) - (dired-revert) - (dired-goto-file tmp-name) - (should-not (dired-compress)) - (should (string= (concat tmp-name ".tar.gz") (dired-get-filename))) - (should-not (dired-compress)) - (should (string= tmp-name (dired-get-filename))) - (delete-directory tmp-name))) - (defun tramp-test-all (&optional interactive) "Run all tests for \\[tramp]. If INTERACTIVE is non-nil, the tests are run interactively." -- 2.25.1