From 864734d112249bac120764f1564e008231ebb6e8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Oct 2017 19:18:37 -0700 Subject: ; Prefer https: to http: in GNU URLs --- test/lisp/progmodes/flymake-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 0b29b6a9715..9f570adcc41 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -37,7 +37,7 @@ ;; ;; (defun flymake-tests--wait-for-backends () - ;; Weirdness here... http://debbugs.gnu.org/17647#25 + ;; Weirdness here... https://debbugs.gnu.org/17647#25 ;; ... meaning `sleep-for', and even ;; `accept-process-output', won't suffice as ways to get ;; process filters and sentinels to run, though they do work -- cgit v1.2.1 From db68cefe72e5c68fa81796028a52de1b8e6480aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Oct 2017 19:36:06 +0300 Subject: Fix errors in kmacro.el post-command-hook * lisp/kmacro.el (kmacro-step-edit-active): Initialize to nil to avoid 'void-variable' errors. (Bug#28818) * test/lisp/kmacro-tests.el (kmacro-tests-step-edit-cleans-up-hook): Now succeeds. (Bug#18708) --- test/lisp/kmacro-tests.el | 1 - 1 file changed, 1 deletion(-) (limited to 'test/lisp') diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el index 9f3eeafe486..690d5029231 100644 --- a/test/lisp/kmacro-tests.el +++ b/test/lisp/kmacro-tests.el @@ -818,7 +818,6 @@ This is a regression for item 7 in Bug#24991." (kmacro-tests-deftest kmacro-tests-step-edit-cleans-up-hook () "Step-editing properly cleans up `post-command-hook.' (Bug #18708)" - (:expected-result :failed) (let (post-command-hook) (setq-local post-command-hook '(t)) (kmacro-tests-run-step-edit "x" -- cgit v1.2.1 From 3ea6a4d4baf67ae88dc8041c6247e9f0e3cd1eab Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 19 Oct 2017 13:37:23 +0200 Subject: Skip an rsync test in tramp-tests.el * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards): Skip for "rsync". --- test/lisp/net/tramp-tests.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/lisp') diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 7cc0779b81c..c88abbfcb26 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2346,6 +2346,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." "Check `dired' with wildcards." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) + (skip-unless (not (tramp--test-rsync-p))) ;; Since Emacs 26.1. (skip-unless (fboundp 'insert-directory-wildcard-in-dir-p)) @@ -4394,6 +4395,7 @@ Since it unloads Tramp, it shall be the last test to run." ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. ;; * Fix `tramp-test06-directory-file-name' for `ftp'. ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). +;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably. ;; * Fix Bug#16928 in `tramp-test38-asynchronous-requests'. (defun tramp-test-all (&optional interactive) -- cgit v1.2.1 From ddd547fada112c603dae7a204fa0b141429f1927 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 19 Oct 2017 20:05:48 -0400 Subject: Improve treatment of Fortran's "class default" * lisp/progmodes/f90.el (f90-start-block-re, f90-no-block-limit): Handle "class default". (Bug#28786) * test/automated/f90.el (f90-test-bug25039): Add "class default". --- test/lisp/progmodes/f90-tests.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el index 0c03a190ca2..2a9100adff6 100644 --- a/test/lisp/progmodes/f90-tests.el +++ b/test/lisp/progmodes/f90-tests.el @@ -256,21 +256,25 @@ end program prog") (should (= 5 (current-indentation))))) (ert-deftest f90-test-bug25039 () - "Test for https://debbugs.gnu.org/25039 ." + "Test for https://debbugs.gnu.org/25039 and 28786." (with-temp-buffer (f90-mode) (insert "program prog select type (a) -class is (c1) -x = 1 type is (t1) x = 2 +class is (c1) +x = 1 +class default +x=3 end select end program prog") (f90-indent-subprogram) (forward-line -3) - (should (= 2 (current-indentation))) ; type is + (should (= 2 (current-indentation))) ; class default + (forward-line -2) + (should (= 2 (current-indentation))) ; class is (forward-line -2) - (should (= 2 (current-indentation))))) ; class is + (should (= 2 (current-indentation))))) ; type is ;;; f90-tests.el ends here -- cgit v1.2.1 From d815de017bb531fed751ee0515ed90b73d7a9936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 20 Oct 2017 11:25:34 +0100 Subject: Skip a Flymake test for old gcc versions Fixes: 28906 * test/lisp/progmodes/flymake-tests.el (different-diagnostic-types): Skip this test for gcc versions < 5. --- test/lisp/progmodes/flymake-tests.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 9f570adcc41..eddd964ad14 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -24,6 +24,7 @@ ;;; Code: (require 'ert) (require 'flymake) +(require 'subr-x) ; string-trim (defvar flymake-tests-data-directory (expand-file-name "lisp/progmodes/flymake-resources" @@ -128,7 +129,11 @@ SEVERITY-PREDICATE is used to setup (ert-deftest different-diagnostic-types () "Test GCC warning via function predicate." - (skip-unless (and (executable-find "gcc") (executable-find "make"))) + (skip-unless (and (executable-find "gcc") + (version<= + "5" (string-trim + (shell-command-to-string "gcc -dumpversion"))) + (executable-find "make"))) (let ((flymake-wrap-around nil)) (flymake-tests--with-flymake ("errors-and-warnings.c") -- cgit v1.2.1 From b500e06f4d05dc094b79f8f2c063e070a5a3306e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 20 Oct 2017 12:46:54 +0200 Subject: Fix Bug#28896 * lisp/net/tramp-adb.el (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Handle FILENAME being a directory. (Bug#28896) * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Test also FILENAME being a directory. --- test/lisp/net/tramp-tests.el | 382 +++++++++++++++++++++---------------------- 1 file changed, 189 insertions(+), 193 deletions(-) (limited to 'test/lisp') diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c88abbfcb26..e92d1b6203c 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1883,96 +1883,98 @@ This checks also `file-name-as-directory', `file-name-directory', (let (quoted) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) - (tmp-name3 (tramp--test-make-temp-name nil quoted)) - (tmp-name4 (tramp--test-make-temp-name 'local quoted)) - (tmp-name5 (tramp--test-make-temp-name 'local quoted))) - - ;; Copy on remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (copy-file tmp-name1 tmp-name2) - (should (file-exists-p tmp-name2)) - (with-temp-buffer - (insert-file-contents tmp-name2) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name1 tmp-name2) - :type 'file-already-exists) - (copy-file tmp-name1 tmp-name2 'ok) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name1 tmp-name3) - :type 'file-already-exists)) - (copy-file tmp-name1 (file-name-as-directory tmp-name3)) - (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))) - - ;; Copy from remote side to local side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (copy-file tmp-name1 tmp-name4) - (should (file-exists-p tmp-name4)) - (with-temp-buffer - (insert-file-contents tmp-name4) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name1 tmp-name4) - :type 'file-already-exists) - (copy-file tmp-name1 tmp-name4 'ok) - (make-directory tmp-name5) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name1 tmp-name5) - :type 'file-already-exists)) - (copy-file tmp-name1 (file-name-as-directory tmp-name5)) - (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))) - - ;; Copy from local side to remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name4 nil 'nomessage) - (copy-file tmp-name4 tmp-name1) - (should (file-exists-p tmp-name1)) - (with-temp-buffer - (insert-file-contents tmp-name1) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name4 tmp-name1) - :type 'file-already-exists) - (copy-file tmp-name4 tmp-name1 'ok) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name4 tmp-name3) - :type 'file-already-exists)) - (copy-file tmp-name4 (file-name-as-directory tmp-name3)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name4) tmp-name3)))) + (tmp-name3 (tramp--test-make-temp-name 'local quoted))) + (dolist (source-target + `(;; Copy on remote side. + (,tmp-name1 . ,tmp-name2) + ;; Copy from remote side to local side. + (,tmp-name1 . ,tmp-name3) + ;; Copy from local side to remote side. + (,tmp-name3 . ,tmp-name1))) + (let ((source (car source-target)) + (target (cdr source-target))) + + ;; Copy simple file. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (copy-file source target) + (should (file-exists-p target)) + (with-temp-buffer + (insert-file-contents target) + (should (string-equal (buffer-string) "foo"))) + (should-error + (copy-file source target) + :type 'file-already-exists) + (copy-file source target 'ok)) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-file target))) + + ;; Copy file to directory. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (make-directory target) + (should (file-directory-p target)) + ;; This has been changed in Emacs 26.1. + (when (tramp--test-emacs26-p) + (should-error + (copy-file source target) + :type 'file-already-exists)) + (copy-file source (file-name-as-directory target)) + (should + (file-exists-p + (expand-file-name (file-name-nondirectory source) target)))) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Copy directory to existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + ;; Directory `target' exists already, so we must use + ;; `file-name-as-directory'. + (copy-file source (file-name-as-directory target)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) + + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Copy directory/file to non-existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + (copy-file + source + (expand-file-name (file-name-nondirectory source) target)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name3 'recursive)))))) + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive)))))))) (ert-deftest tramp-test12-rename-file () "Check `rename-file'." @@ -1983,111 +1985,105 @@ This checks also `file-name-as-directory', `file-name-directory', (let (quoted) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) - (tmp-name3 (tramp--test-make-temp-name nil quoted)) - (tmp-name4 (tramp--test-make-temp-name 'local quoted)) - (tmp-name5 (tramp--test-make-temp-name 'local quoted))) - - ;; Rename on remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (rename-file tmp-name1 tmp-name2) - (should-not (file-exists-p tmp-name1)) - (should (file-exists-p tmp-name2)) - (with-temp-buffer - (insert-file-contents tmp-name2) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name1) - (should-error - (rename-file tmp-name1 tmp-name2) - :type 'file-already-exists) - (rename-file tmp-name1 tmp-name2 'ok) - (should-not (file-exists-p tmp-name1)) - (write-region "foo" nil tmp-name1) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name1 tmp-name3) - :type 'file-already-exists)) - (rename-file tmp-name1 (file-name-as-directory tmp-name3)) - (should-not (file-exists-p tmp-name1)) - (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))) - - ;; Rename from remote side to local side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (rename-file tmp-name1 tmp-name4) - (should-not (file-exists-p tmp-name1)) - (should (file-exists-p tmp-name4)) - (with-temp-buffer - (insert-file-contents tmp-name4) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name1) - (should-error - (rename-file tmp-name1 tmp-name4) - :type 'file-already-exists) - (rename-file tmp-name1 tmp-name4 'ok) - (should-not (file-exists-p tmp-name1)) - (write-region "foo" nil tmp-name1) - (make-directory tmp-name5) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name1 tmp-name5) - :type 'file-already-exists)) - (rename-file tmp-name1 (file-name-as-directory tmp-name5)) - (should-not (file-exists-p tmp-name1)) - (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))) - - ;; Rename from local side to remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name4 nil 'nomessage) - (rename-file tmp-name4 tmp-name1) - (should-not (file-exists-p tmp-name4)) - (should (file-exists-p tmp-name1)) - (with-temp-buffer - (insert-file-contents tmp-name1) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name4 nil 'nomessage) - (should-error - (rename-file tmp-name4 tmp-name1) - :type 'file-already-exists) - (rename-file tmp-name4 tmp-name1 'ok) - (should-not (file-exists-p tmp-name4)) - (write-region "foo" nil tmp-name4 nil 'nomessage) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name4 tmp-name3) - :type 'file-already-exists)) - (rename-file tmp-name4 (file-name-as-directory tmp-name3)) - (should-not (file-exists-p tmp-name4)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name4) tmp-name3)))) + (tmp-name3 (tramp--test-make-temp-name 'local quoted))) + (dolist (source-target + `(;; Rename on remote side. + (,tmp-name1 . ,tmp-name2) + ;; Rename from remote side to local side. + (,tmp-name1 . ,tmp-name3) + ;; Rename from local side to remote side. + (,tmp-name3 . ,tmp-name1))) + (let ((source (car source-target)) + (target (cdr source-target))) + + ;; Rename simple file. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (rename-file source target) + (should-not (file-exists-p source)) + (should (file-exists-p target)) + (with-temp-buffer + (insert-file-contents target) + (should (string-equal (buffer-string) "foo"))) + (write-region "foo" nil source) + (should (file-exists-p source)) + (should-error + (rename-file source target) + :type 'file-already-exists) + (rename-file source target 'ok) + (should-not (file-exists-p source))) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-file target))) + + ;; Rename file to directory. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (make-directory target) + (should (file-directory-p target)) + ;; This has been changed in Emacs 26.1. + (when (tramp--test-emacs26-p) + (should-error + (rename-file source target) + :type 'file-already-exists)) + (rename-file source (file-name-as-directory target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name (file-name-nondirectory source) target)))) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Rename directory to existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + ;; Directory `target' exists already, so we must use + ;; `file-name-as-directory'. + (rename-file source (file-name-as-directory target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) + + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Rename directory/file to non-existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + (rename-file + source + (expand-file-name (file-name-nondirectory source) target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name3 'recursive)))))) + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive)))))))) (ert-deftest tramp-test13-make-directory () "Check `make-directory'. -- cgit v1.2.1 From 11bd8aa24b347f75e674528dd1a94b0a4037105e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 20 Oct 2017 13:07:30 -0400 Subject: Fix flymake's loading of subr-x * lisp/progmodes/flymake.el, test/lisp/progmodes/flymake-tests.el: No need to load subr-x at run-time. --- test/lisp/progmodes/flymake-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/lisp') diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index eddd964ad14..cfa810053ca 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -24,7 +24,7 @@ ;;; Code: (require 'ert) (require 'flymake) -(require 'subr-x) ; string-trim +(eval-when-compile (require 'subr-x)) ; string-trim (defvar flymake-tests-data-directory (expand-file-name "lisp/progmodes/flymake-resources" -- cgit v1.2.1