aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPaul Eggert2017-11-02 21:01:04 -0700
committerPaul Eggert2017-11-02 21:01:04 -0700
commitc66a3944edca6150c9252e15a0ea75c96225481b (patch)
tree888bfa31967a17c174ba61d0a8547dd64658060a /test
parent770f245cdf2cf9e74e49bb32afb77562d9b1ad6d (diff)
parent7f089aa5f6d208209b2cfef8e0d3d9530e191248 (diff)
downloademacs-c66a3944edca6150c9252e15a0ea75c96225481b.tar.gz
emacs-c66a3944edca6150c9252e15a0ea75c96225481b.zip
Merge from origin/emacs-26
7f089aa5f6 Require seq in rmc.el 53aaad1dfc Make an example code introduced in the Gnus info work (bug... 7b29db222f Enable gnus-read-ephemeral-* to run multiple times (bug#29... 015f0bb2d8 Port thread.c to OpenBSD ARM ad68bbd0da Fix another "wrong side of point" error in CC Mode. 646e56e150 Fix Bug#28959 685fd77959 Fix duplicate .o file on QNX e562356c3f Fix two js indentation problems b8cf159bbc Update documentation for windows build 46540a1c7a Fix a "wrong side of point" error in CC Mode. Fixes bug #... 57ca409111 Fix autoload of flymake from elisp-mode during bootstrap (... aee0bc8775 Fix non-native fullscreen on NS (bug#28872) d6c1a9cb8a ; Fix author email address in test/lisp/url/url-tramp-test... 761c630766 Fix Bug#28982 628b653209 Fix windows build errors e8a06a5f9a Fix compile warning for non-w32 builds 0c536a20fb Display commit in package description, if available (Bug#2... 1d83257a1d Port to QNX 19667f44ef * configure.ac: Tweak libcurses diagnostic. 3fc05cfaec Scripts to automate windows binary distribution 928a106939 Fix Edebug specs for map-let and with-maps-do 46f2ee0d4c * test/lisp/net/tramp-tests.el (tramp-test41-delay-load): ... b51009d7f0 * admin/authors.el (authors-canonical-author-name): Ignore... a015db90e3 * test/lisp/progmodes/sql-tests.el (sql-tests-postgres-lis... 529a9c09d3 Further work on Bug#28889 c6deabaf4d Improve Tramp backward compatibility 8093e82e42 Improve backward compatibility of tramp-tests.el 46cdc01daa Fix some ‘window-normalize-’ prefixed functions (Bug#28947) 6360611457 Port to OpenIndiana a012ec766c Don't fill keywords after Emacs Lisp docstring b7c4aa951c Refactor c-forward-token-2 with new function c-forward-ove... 3aee7be62e Avoid unnecessary rounding errors in timestamps 2bfa42855b Fix xdg timestamp error on 32-bit Emacs 237e96bc52 Test that advice doesn't trigger bytecomp warnings (Bug#28... d719ea6ad5 Another fix for unsafe directory error message (Bug#865) b060e091c3 Handle https url for debbugs mbox (Bug#28831) 9e4265ef91 Ignore string properties when saving eshell history (Bug#2... 0f286ca85a Fix Bug#28889
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el11
-rw-r--r--test/lisp/emacs-lisp/lisp-tests.el31
-rw-r--r--test/lisp/emacs-lisp/map-tests.el2
-rw-r--r--test/lisp/emacs-lisp/rmc-tests.el41
-rw-r--r--test/lisp/eshell/em-hist-tests.el39
-rw-r--r--test/lisp/eshell/eshell-tests.el2
-rw-r--r--test/lisp/net/tramp-tests.el157
-rw-r--r--test/lisp/progmodes/sql-tests.el2
-rw-r--r--test/lisp/url/url-tramp-tests.el83
-rw-r--r--test/manual/indent/js.js9
10 files changed, 355 insertions, 22 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 30d2a4753cf..f508c365427 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -564,6 +564,17 @@ and will be removed soon. See (elisp)Backquote in the manual.")))))))
564 (byte-compile-file source t) 564 (byte-compile-file source t)
565 (should (equal bytecomp-tests--foobar (cons 1 2))))) 565 (should (equal bytecomp-tests--foobar (cons 1 2)))))
566 566
567(ert-deftest bytecomp-tests--test-no-warnings-with-advice ()
568 (defun f ())
569 (define-advice f (:around (oldfun &rest args) test)
570 (apply oldfun args))
571 (with-current-buffer (get-buffer-create "*Compile-Log*")
572 (let ((inhibit-read-only t)) (erase-buffer)))
573 (test-byte-comp-compile-and-load t '(defun f ()))
574 (with-current-buffer (get-buffer-create "*Compile-Log*")
575 (goto-char (point-min))
576 (should-not (search-forward "Warning" nil t))))
577
567;; Local Variables: 578;; Local Variables:
568;; no-byte-compile: t 579;; no-byte-compile: t
569;; End: 580;; End:
diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el
index ae1302bdce4..654d949d388 100644
--- a/test/lisp/emacs-lisp/lisp-tests.el
+++ b/test/lisp/emacs-lisp/lisp-tests.el
@@ -589,5 +589,36 @@ region."
589 (should (= (point) before)) 589 (should (= (point) before))
590 (should (= (mark) after)))) 590 (should (= (mark) after))))
591 591
592(ert-deftest lisp-fill-paragraph-colon ()
593 "Keywords below Emacs Lisp docstrings should not be filled (Bug#24622).
594Keywords inside docstrings should be filled (Bug#7751)."
595 (elisp-tests-with-temp-buffer
596 "
597\(defcustom custom value
598 \"First\n
599Second\n
600=!inside=Third line\"
601 =!keywords=:type 'sexp
602 :version \"26.1\"
603 :group 'lisp-tests)"
604 (goto-char inside)
605 (fill-paragraph)
606 (goto-char keywords)
607 (beginning-of-line)
608 (should (looking-at " :type 'sexp\n :version \"26.1\"\n :")))
609 (elisp-tests-with-temp-buffer
610 "
611\(defun foo ()
612 \"Summary.
613=!inside=Testing keywords: :one :two :three\"
614 (body))" ; FIXME: Remove parens around body to test Bug#28937 once it's fixed
615 (goto-char inside)
616 (let ((emacs-lisp-docstring-fill-column 30))
617 (fill-paragraph))
618 (forward-line)
619 (should (looking-at ":three"))
620 (end-of-line)
621 (should-not (eq (preceding-char) ?\)))))
622
592(provide 'lisp-tests) 623(provide 'lisp-tests)
593;;; lisp-tests.el ends here 624;;; lisp-tests.el ends here
diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el
index 0a888d88b72..a434c9bd066 100644
--- a/test/lisp/emacs-lisp/map-tests.el
+++ b/test/lisp/emacs-lisp/map-tests.el
@@ -36,7 +36,7 @@ Each map is built from the following alist data:
36Evaluate BODY for each created map. 36Evaluate BODY for each created map.
37 37
38\(fn (var map) body)" 38\(fn (var map) body)"
39 (declare (indent 1) (debug t)) 39 (declare (indent 1) (debug (symbolp body)))
40 (let ((alist (make-symbol "alist")) 40 (let ((alist (make-symbol "alist"))
41 (vec (make-symbol "vec")) 41 (vec (make-symbol "vec"))
42 (ht (make-symbol "ht"))) 42 (ht (make-symbol "ht")))
diff --git a/test/lisp/emacs-lisp/rmc-tests.el b/test/lisp/emacs-lisp/rmc-tests.el
new file mode 100644
index 00000000000..7ab79fda774
--- /dev/null
+++ b/test/lisp/emacs-lisp/rmc-tests.el
@@ -0,0 +1,41 @@
1;;; rmc-tests.el --- Test suite for rmc.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2017 Free Software Foundation, Inc.
4
5;; Author: Tino Calancha <tino.calancha@gmail.com>
6;; Keywords:
7
8;; This program is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
12
13;; This program is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21;;; Commentary:
22
23;;
24
25;;; Code:
26
27(require 'ert)
28(require 'rmc)
29(eval-when-compile (require 'cl-lib))
30
31
32(ert-deftest test-read-multiple-choice ()
33 (dolist (char '(?y ?n))
34 (cl-letf* (((symbol-function #'read-char) (lambda () char))
35 (str (if (eq char ?y) "yes" "no")))
36 (should (equal (list char str)
37 (read-multiple-choice "Do it? " '((?y "yes") (?n "no"))))))))
38
39
40(provide 'rmc-tests)
41;;; rmc-tests.el ends here
diff --git a/test/lisp/eshell/em-hist-tests.el b/test/lisp/eshell/em-hist-tests.el
new file mode 100644
index 00000000000..7e0d6142812
--- /dev/null
+++ b/test/lisp/eshell/em-hist-tests.el
@@ -0,0 +1,39 @@
1;;; tests/em-hist-tests.el --- em-hist test suite
2
3;; Copyright (C) 2017 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Code:
21
22(require 'ert)
23(require 'em-hist)
24
25(ert-deftest eshell-write-readonly-history ()
26 "Test that having read-only strings in history is okay."
27 (let ((histfile (make-temp-file "eshell-history"))
28 (eshell-history-ring (make-ring 2)))
29 (ring-insert eshell-history-ring
30 (propertize "echo foo" 'read-only t))
31 (ring-insert eshell-history-ring
32 (propertize "echo bar" 'read-only t))
33 (unwind-protect
34 (eshell-write-history histfile)
35 (delete-file histfile))))
36
37(provide 'em-hist-test)
38
39;;; em-hist-tests.el ends here
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 4e0d6dc7621..58b8aa58bf1 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -247,6 +247,6 @@ chars"
247 (goto-char eshell-last-input-start) 247 (goto-char eshell-last-input-start)
248 (string= (eshell-get-old-input) "echo alpha"))) 248 (string= (eshell-get-old-input) "echo alpha")))
249 249
250(provide 'esh-test) 250(provide 'eshell-tests)
251 251
252;;; tests/eshell-tests.el ends here 252;;; tests/eshell-tests.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index e92d1b6203c..af707f85007 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3638,8 +3638,103 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3638 (ignore-errors (delete-file tmp-name1)) 3638 (ignore-errors (delete-file tmp-name1))
3639 (ignore-errors (delete-directory tmp-name2 'recursive)))))) 3639 (ignore-errors (delete-directory tmp-name2 'recursive))))))
3640 3640
3641(ert-deftest tramp-test34-find-backup-file-name ()
3642 "Check `find-backup-file-name'."
3643 (skip-unless (tramp--test-enabled))
3644
3645 (dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
3646 (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
3647 (tmp-name2 (tramp--test-make-temp-name nil quoted))
3648 ;; These settings are not used by Tramp, so we ignore them.
3649 version-control delete-old-versions
3650 (kept-old-versions (default-toplevel-value 'kept-old-versions))
3651 (kept-new-versions (default-toplevel-value 'kept-new-versions)))
3652
3653 (unwind-protect
3654 ;; Use default `backup-directory-alist' mechanism.
3655 (let (backup-directory-alist tramp-backup-directory-alist)
3656 (should
3657 (equal
3658 (find-backup-file-name tmp-name1)
3659 (list
3660 (funcall
3661 (if quoted 'tramp-compat-file-name-quote 'identity)
3662 (expand-file-name
3663 (format "%s~" (file-name-nondirectory tmp-name1))
3664 tramp-test-temporary-file-directory)))))))
3665
3666 (unwind-protect
3667 ;; Map `backup-directory-alist'.
3668 (let ((backup-directory-alist `(("." . ,tmp-name2)))
3669 tramp-backup-directory-alist)
3670 (should
3671 (equal
3672 (find-backup-file-name tmp-name1)
3673 (list
3674 (funcall
3675 (if quoted 'tramp-compat-file-name-quote 'identity)
3676 (expand-file-name
3677 (format
3678 "%s~"
3679 ;; This is taken from `make-backup-file-name-1'.
3680 (subst-char-in-string
3681 ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
3682 tmp-name2)))))
3683 ;; The backup directory is created.
3684 (should (file-directory-p tmp-name2)))
3685
3686 ;; Cleanup.
3687 (ignore-errors (delete-directory tmp-name2 'recursive)))
3688
3689 (unwind-protect
3690 ;; Map `tramp-backup-directory-alist'.
3691 (let ((tramp-backup-directory-alist `(("." . ,tmp-name2)))
3692 backup-directory-alist)
3693 (should
3694 (equal
3695 (find-backup-file-name tmp-name1)
3696 (list
3697 (funcall
3698 (if quoted 'tramp-compat-file-name-quote 'identity)
3699 (expand-file-name
3700 (format
3701 "%s~"
3702 ;; This is taken from `make-backup-file-name-1'.
3703 (subst-char-in-string
3704 ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
3705 tmp-name2)))))
3706 ;; The backup directory is created.
3707 (should (file-directory-p tmp-name2)))
3708
3709 ;; Cleanup.
3710 (ignore-errors (delete-directory tmp-name2 'recursive)))
3711
3712 (unwind-protect
3713 ;; Map `tramp-backup-directory-alist' with local file name.
3714 (let ((tramp-backup-directory-alist
3715 `(("." . ,(file-remote-p tmp-name2 'localname))))
3716 backup-directory-alist)
3717 (should
3718 (equal
3719 (find-backup-file-name tmp-name1)
3720 (list
3721 (funcall
3722 (if quoted 'tramp-compat-file-name-quote 'identity)
3723 (expand-file-name
3724 (format
3725 "%s~"
3726 ;; This is taken from `make-backup-file-name-1'.
3727 (subst-char-in-string
3728 ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
3729 tmp-name2)))))
3730 ;; The backup directory is created.
3731 (should (file-directory-p tmp-name2)))
3732
3733 ;; Cleanup.
3734 (ignore-errors (delete-directory tmp-name2 'recursive))))))
3735
3641;; The functions were introduced in Emacs 26.1. 3736;; The functions were introduced in Emacs 26.1.
3642(ert-deftest tramp-test34-make-nearby-temp-file () 3737(ert-deftest tramp-test35-make-nearby-temp-file ()
3643 "Check `make-nearby-temp-file' and `temporary-file-directory'." 3738 "Check `make-nearby-temp-file' and `temporary-file-directory'."
3644 (skip-unless (tramp--test-enabled)) 3739 (skip-unless (tramp--test-enabled))
3645 ;; Since Emacs 26.1. 3740 ;; Since Emacs 26.1.
@@ -3678,7 +3773,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3678(defun tramp--test-emacs26-p () 3773(defun tramp--test-emacs26-p ()
3679 "Check for Emacs version >= 26.1. 3774 "Check for Emacs version >= 26.1.
3680Some semantics has been changed for there, w/o new functions or 3775Some semantics has been changed for there, w/o new functions or
3681variables, so we check function Emacs version directly." 3776variables, so we check the Emacs version directly."
3682 (>= emacs-major-version 26)) 3777 (>= emacs-major-version 26))
3683 3778
3684(defun tramp--test-adb-p () 3779(defun tramp--test-adb-p ()
@@ -3904,7 +3999,7 @@ This requires restrictions of file name syntax."
3904 (ignore-errors (delete-directory tmp-name2 'recursive)))))) 3999 (ignore-errors (delete-directory tmp-name2 'recursive))))))
3905 4000
3906(defun tramp--test-special-characters () 4001(defun tramp--test-special-characters ()
3907 "Perform the test in `tramp-test35-special-characters*'." 4002 "Perform the test in `tramp-test36-special-characters*'."
3908 ;; Newlines, slashes and backslashes in file names are not 4003 ;; Newlines, slashes and backslashes in file names are not
3909 ;; supported. So we don't test. And we don't test the tab 4004 ;; supported. So we don't test. And we don't test the tab
3910 ;; character on Windows or Cygwin, because the backslash is 4005 ;; character on Windows or Cygwin, because the backslash is
@@ -3947,7 +4042,7 @@ This requires restrictions of file name syntax."
3947 "{foo}bar{baz}")) 4042 "{foo}bar{baz}"))
3948 4043
3949;; These tests are inspired by Bug#17238. 4044;; These tests are inspired by Bug#17238.
3950(ert-deftest tramp-test35-special-characters () 4045(ert-deftest tramp-test36-special-characters ()
3951 "Check special characters in file names." 4046 "Check special characters in file names."
3952 (skip-unless (tramp--test-enabled)) 4047 (skip-unless (tramp--test-enabled))
3953 (skip-unless (not (tramp--test-rsync-p))) 4048 (skip-unless (not (tramp--test-rsync-p)))
@@ -3955,7 +4050,7 @@ This requires restrictions of file name syntax."
3955 4050
3956 (tramp--test-special-characters)) 4051 (tramp--test-special-characters))
3957 4052
3958(ert-deftest tramp-test35-special-characters-with-stat () 4053(ert-deftest tramp-test36-special-characters-with-stat ()
3959 "Check special characters in file names. 4054 "Check special characters in file names.
3960Use the `stat' command." 4055Use the `stat' command."
3961 :tags '(:expensive-test) 4056 :tags '(:expensive-test)
@@ -3973,7 +4068,7 @@ Use the `stat' command."
3973 tramp-connection-properties))) 4068 tramp-connection-properties)))
3974 (tramp--test-special-characters))) 4069 (tramp--test-special-characters)))
3975 4070
3976(ert-deftest tramp-test35-special-characters-with-perl () 4071(ert-deftest tramp-test36-special-characters-with-perl ()
3977 "Check special characters in file names. 4072 "Check special characters in file names.
3978Use the `perl' command." 4073Use the `perl' command."
3979 :tags '(:expensive-test) 4074 :tags '(:expensive-test)
@@ -3994,7 +4089,7 @@ Use the `perl' command."
3994 tramp-connection-properties))) 4089 tramp-connection-properties)))
3995 (tramp--test-special-characters))) 4090 (tramp--test-special-characters)))
3996 4091
3997(ert-deftest tramp-test35-special-characters-with-ls () 4092(ert-deftest tramp-test36-special-characters-with-ls ()
3998 "Check special characters in file names. 4093 "Check special characters in file names.
3999Use the `ls' command." 4094Use the `ls' command."
4000 :tags '(:expensive-test) 4095 :tags '(:expensive-test)
@@ -4017,7 +4112,7 @@ Use the `ls' command."
4017 (tramp--test-special-characters))) 4112 (tramp--test-special-characters)))
4018 4113
4019(defun tramp--test-utf8 () 4114(defun tramp--test-utf8 ()
4020 "Perform the test in `tramp-test36-utf8*'." 4115 "Perform the test in `tramp-test37-utf8*'."
4021 (let* ((utf8 (if (and (eq system-type 'darwin) 4116 (let* ((utf8 (if (and (eq system-type 'darwin)
4022 (memq 'utf-8-hfs (coding-system-list))) 4117 (memq 'utf-8-hfs (coding-system-list)))
4023 'utf-8-hfs 'utf-8)) 4118 'utf-8-hfs 'utf-8))
@@ -4032,7 +4127,7 @@ Use the `ls' command."
4032 "银河系漫游指南系列" 4127 "银河系漫游指南系列"
4033 "Автостопом по гала́ктике"))) 4128 "Автостопом по гала́ктике")))
4034 4129
4035(ert-deftest tramp-test36-utf8 () 4130(ert-deftest tramp-test37-utf8 ()
4036 "Check UTF8 encoding in file names and file contents." 4131 "Check UTF8 encoding in file names and file contents."
4037 (skip-unless (tramp--test-enabled)) 4132 (skip-unless (tramp--test-enabled))
4038 (skip-unless (not (tramp--test-docker-p))) 4133 (skip-unless (not (tramp--test-docker-p)))
@@ -4042,7 +4137,7 @@ Use the `ls' command."
4042 4137
4043 (tramp--test-utf8)) 4138 (tramp--test-utf8))
4044 4139
4045(ert-deftest tramp-test36-utf8-with-stat () 4140(ert-deftest tramp-test37-utf8-with-stat ()
4046 "Check UTF8 encoding in file names and file contents. 4141 "Check UTF8 encoding in file names and file contents.
4047Use the `stat' command." 4142Use the `stat' command."
4048 :tags '(:expensive-test) 4143 :tags '(:expensive-test)
@@ -4062,7 +4157,7 @@ Use the `stat' command."
4062 tramp-connection-properties))) 4157 tramp-connection-properties)))
4063 (tramp--test-utf8))) 4158 (tramp--test-utf8)))
4064 4159
4065(ert-deftest tramp-test36-utf8-with-perl () 4160(ert-deftest tramp-test37-utf8-with-perl ()
4066 "Check UTF8 encoding in file names and file contents. 4161 "Check UTF8 encoding in file names and file contents.
4067Use the `perl' command." 4162Use the `perl' command."
4068 :tags '(:expensive-test) 4163 :tags '(:expensive-test)
@@ -4085,7 +4180,7 @@ Use the `perl' command."
4085 tramp-connection-properties))) 4180 tramp-connection-properties)))
4086 (tramp--test-utf8))) 4181 (tramp--test-utf8)))
4087 4182
4088(ert-deftest tramp-test36-utf8-with-ls () 4183(ert-deftest tramp-test37-utf8-with-ls ()
4089 "Check UTF8 encoding in file names and file contents. 4184 "Check UTF8 encoding in file names and file contents.
4090Use the `ls' command." 4185Use the `ls' command."
4091 :tags '(:expensive-test) 4186 :tags '(:expensive-test)
@@ -4108,7 +4203,7 @@ Use the `ls' command."
4108 tramp-connection-properties))) 4203 tramp-connection-properties)))
4109 (tramp--test-utf8))) 4204 (tramp--test-utf8)))
4110 4205
4111(ert-deftest tramp-test37-file-system-info () 4206(ert-deftest tramp-test38-file-system-info ()
4112 "Check that `file-system-info' returns proper values." 4207 "Check that `file-system-info' returns proper values."
4113 (skip-unless (tramp--test-enabled)) 4208 (skip-unless (tramp--test-enabled))
4114 ;; Since Emacs 27.1. 4209 ;; Since Emacs 27.1.
@@ -4130,7 +4225,7 @@ Use the `ls' command."
4130 (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) 4225 (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test)))))
4131 4226
4132;; This test is inspired by Bug#16928. 4227;; This test is inspired by Bug#16928.
4133(ert-deftest tramp-test38-asynchronous-requests () 4228(ert-deftest tramp-test39-asynchronous-requests ()
4134 "Check parallel asynchronous requests. 4229 "Check parallel asynchronous requests.
4135Such requests could arrive from timers, process filters and 4230Such requests could arrive from timers, process filters and
4136process sentinels. They shall not disturb each other." 4231process sentinels. They shall not disturb each other."
@@ -4287,7 +4382,7 @@ process sentinels. They shall not disturb each other."
4287 (ignore-errors (cancel-timer timer)) 4382 (ignore-errors (cancel-timer timer))
4288 (ignore-errors (delete-directory tmp-name 'recursive))))))) 4383 (ignore-errors (delete-directory tmp-name 'recursive)))))))
4289 4384
4290(ert-deftest tramp-test39-recursive-load () 4385(ert-deftest tramp-test40-recursive-load ()
4291 "Check that Tramp does not fail due to recursive load." 4386 "Check that Tramp does not fail due to recursive load."
4292 (skip-unless (tramp--test-enabled)) 4387 (skip-unless (tramp--test-enabled))
4293 4388
@@ -4310,7 +4405,7 @@ process sentinels. They shall not disturb each other."
4310 (mapconcat 'shell-quote-argument load-path " -L ") 4405 (mapconcat 'shell-quote-argument load-path " -L ")
4311 (shell-quote-argument code)))))))) 4406 (shell-quote-argument code))))))))
4312 4407
4313(ert-deftest tramp-test40-remote-load-path () 4408(ert-deftest tramp-test41-remote-load-path ()
4314 "Check that Tramp autoloads its packages with remote `load-path'." 4409 "Check that Tramp autoloads its packages with remote `load-path'."
4315 ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. 4410 ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el.
4316 ;; It shall still work, when a remote file name is in the 4411 ;; It shall still work, when a remote file name is in the
@@ -4333,11 +4428,36 @@ process sentinels. They shall not disturb each other."
4333 (mapconcat 'shell-quote-argument load-path " -L ") 4428 (mapconcat 'shell-quote-argument load-path " -L ")
4334 (shell-quote-argument code))))))) 4429 (shell-quote-argument code)))))))
4335 4430
4336(ert-deftest tramp-test41-unload () 4431(ert-deftest tramp-test42-delay-load ()
4432 "Check that Tramp is loaded lazily, only when needed."
4433 ;; Tramp is neither loaded at Emacs startup, nor when completing a
4434 ;; non-Tramp file name like "/foo". Completing a Tramp-alike file
4435 ;; name like "/foo:" autoloads Tramp.
4436 (let ((code
4437 "(progn \
4438 (message \"Tramp loaded: %s\" (featurep 'tramp)) \
4439 (file-name-all-completions \"/foo\" \"/\") \
4440 (message \"Tramp loaded: %s\" (featurep 'tramp)) \
4441 (file-name-all-completions \"/foo:\" \"/\") \
4442 (message \"Tramp loaded: %s\" (featurep 'tramp)))"))
4443 (should
4444 (string-match
4445 "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+"
4446 (shell-command-to-string
4447 (format
4448 "%s -batch -Q -L %s --eval %s"
4449 (expand-file-name invocation-name invocation-directory)
4450 (mapconcat 'shell-quote-argument load-path " -L ")
4451 (shell-quote-argument code)))))))
4452
4453(ert-deftest tramp-test43-unload ()
4337 "Check that Tramp and its subpackages unload completely. 4454 "Check that Tramp and its subpackages unload completely.
4338Since it unloads Tramp, it shall be the last test to run." 4455Since it unloads Tramp, it shall be the last test to run."
4339 :tags '(:expensive-test) 4456 :tags '(:expensive-test)
4340 (skip-unless noninteractive) 4457 (skip-unless noninteractive)
4458 ;; The autoloaded Tramp objects are different since Emacs 26.1. We
4459 ;; cannot test older Emacsen, therefore.
4460 (skip-unless (tramp--test-emacs26-p))
4341 4461
4342 (when (featurep 'tramp) 4462 (when (featurep 'tramp)
4343 (unload-feature 'tramp 'force) 4463 (unload-feature 'tramp 'force)
@@ -4383,7 +4503,6 @@ Since it unloads Tramp, it shall be the last test to run."
4383;; * file-acl 4503;; * file-acl
4384;; * file-name-case-insensitive-p 4504;; * file-name-case-insensitive-p
4385;; * file-selinux-context 4505;; * file-selinux-context
4386;; * find-backup-file-name
4387;; * set-file-acl 4506;; * set-file-acl
4388;; * set-file-selinux-context 4507;; * set-file-selinux-context
4389 4508
@@ -4392,7 +4511,7 @@ Since it unloads Tramp, it shall be the last test to run."
4392;; * Fix `tramp-test06-directory-file-name' for `ftp'. 4511;; * Fix `tramp-test06-directory-file-name' for `ftp'.
4393;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). 4512;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?).
4394;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably. 4513;; * Fix `tramp-test28-interrupt-process', timeout doesn't work reliably.
4395;; * Fix Bug#16928 in `tramp-test38-asynchronous-requests'. 4514;; * Fix Bug#16928 in `tramp-test39-asynchronous-requests'.
4396 4515
4397(defun tramp-test-all (&optional interactive) 4516(defun tramp-test-all (&optional interactive)
4398 "Run all tests for \\[tramp]." 4517 "Run all tests for \\[tramp]."
diff --git a/test/lisp/progmodes/sql-tests.el b/test/lisp/progmodes/sql-tests.el
index ad22906ecf1..15f59529b2a 100644
--- a/test/lisp/progmodes/sql-tests.el
+++ b/test/lisp/progmodes/sql-tests.el
@@ -50,7 +50,7 @@
50 (lambda (_command) t)) 50 (lambda (_command) t))
51 ((symbol-function 'process-lines) 51 ((symbol-function 'process-lines)
52 (lambda (_program &rest _args) 52 (lambda (_program &rest _args)
53 (error)))) 53 (error "some error"))))
54 (should-not (sql-postgres-list-databases)))) 54 (should-not (sql-postgres-list-databases))))
55 55
56(provide 'sql-tests) 56(provide 'sql-tests)
diff --git a/test/lisp/url/url-tramp-tests.el b/test/lisp/url/url-tramp-tests.el
new file mode 100644
index 00000000000..1154d4cb118
--- /dev/null
+++ b/test/lisp/url/url-tramp-tests.el
@@ -0,0 +1,83 @@
1;;; url-tramp-tests.el --- Test suite for Tramp / URL conversion.
2
3;; Copyright (C) 2017 Free Software Foundation, Inc.
4
5;; Author: Michael Albinus <michael.albinus@gmx.de>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
21
22;;; Code:
23
24(require 'url-tramp)
25(require 'ert)
26
27(ert-deftest url-tramp-test-convert-url-to-tramp ()
28 "Test that URLs are converted into proper Tramp file names."
29 (should
30 (string-equal
31 (url-tramp-convert-url-to-tramp "ftp://ftp.is.co.za/rfc/rfc1808.txt")
32 "/ftp:ftp.is.co.za:/rfc/rfc1808.txt"))
33
34 (should
35 (string-equal
36 (url-tramp-convert-url-to-tramp "ssh://user@localhost")
37 "/ssh:user@localhost:"))
38
39 (should
40 (string-equal
41 (url-tramp-convert-url-to-tramp "telnet://remotehost:42")
42 "/telnet:remotehost#42:"))
43
44 ;; The password will be added to the cache. The password cache key
45 ;; is the remote file name identification of the Tramp file.
46 (should
47 (string-equal
48 (url-tramp-convert-url-to-tramp "scp://user:geheim@somewhere/localfile")
49 "/scp:user@somewhere:/localfile"))
50 (let ((key
51 (file-remote-p
52 (url-tramp-convert-url-to-tramp "scp://user@somewhere/localfile"))))
53 (should (password-in-cache-p key))
54 (should (string-equal (password-read-from-cache key) "geheim"))
55 (password-cache-remove key)
56 (should-not (password-in-cache-p key)))
57
58 ;; "http" does not belong to `url-tramp-protocols'.
59 (should-not (url-tramp-convert-url-to-tramp "http://www.gnu.org")))
60
61(ert-deftest url-tramp-test-convert-tramp-to-url ()
62 "Test that Tramp file names are converted into proper URLs."
63 (should
64 (string-equal
65 (url-tramp-convert-tramp-to-url "/ftp:ftp.is.co.za:/rfc/rfc1808.txt")
66 "ftp://ftp.is.co.za/rfc/rfc1808.txt"))
67
68 (should
69 (string-equal
70 (url-tramp-convert-tramp-to-url "/ssh:user@localhost:")
71 "ssh://user@localhost"))
72
73 (should
74 (string-equal
75 (url-tramp-convert-tramp-to-url "/telnet:user@remotehost#42:")
76 "telnet://user@remotehost:42"))
77
78 ;; "sftp" does not belong to `url-tramp-protocols'.
79 (should-not (url-tramp-convert-tramp-to-url "/sftp:user@localhost:")))
80
81(provide 'url-tramp-tests)
82
83;;; url-tramp-tests.el ends here
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index 1ad76a83e18..b0d8bcabd20 100644
--- a/test/manual/indent/js.js
+++ b/test/manual/indent/js.js
@@ -7,6 +7,9 @@ let c = 1,
7var e = 100500, 7var e = 100500,
8 + 1; 8 + 1;
9 9
10// Don't misinterpret "const"
11/const/
12
10function test () 13function test ()
11{ 14{
12 return /[/]/.test ('/') // (bug#19397) 15 return /[/]/.test ('/') // (bug#19397)
@@ -135,6 +138,12 @@ if (1) {
135 : 4 138 : 4
136} 139}
137 140
141// Regexp is not a continuation
142bar(
143 "string arg1",
144 /abc/
145)
146
138// Local Variables: 147// Local Variables:
139// indent-tabs-mode: nil 148// indent-tabs-mode: nil
140// js-indent-level: 2 149// js-indent-level: 2