diff options
| author | Noam Postavsky | 2018-07-09 20:06:27 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-07-09 20:06:27 -0400 |
| commit | 6b8349a90274686d9cb67a2ffaac2d930d5f6b46 (patch) | |
| tree | d2fbc56f7a21120951cb0c14bbe349e388b35e62 /test | |
| parent | 6de90fb41b63d33457c1fa41cbb4bd8b25e4cc7f (diff) | |
| parent | db3f7797809ed9de8dd92ce38bf34f768ddc64ad (diff) | |
| download | emacs-6b8349a90274686d9cb67a2ffaac2d930d5f6b46.tar.gz emacs-6b8349a90274686d9cb67a2ffaac2d930d5f6b46.zip | |
Merge from emacs-26
db3f779780 ; Test for Bug#32014
90d95b000c Explicitly reject :server and :nowait (Bug#31903)
917158f8c9 Fix Bug#32090
# Conflicts:
# src/process.c
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/lisp-mode-tests.el | 11 | ||||
| -rw-r--r-- | test/lisp/files-x-tests.el | 55 |
2 files changed, 46 insertions, 20 deletions
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index 0b5b0a40198..2ac0e5ce1d4 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el | |||
| @@ -224,6 +224,17 @@ Expected initialization file: `%s'\" | |||
| 224 | (comment-indent) | 224 | (comment-indent) |
| 225 | (should (equal (buffer-string) correct))))) | 225 | (should (equal (buffer-string) correct))))) |
| 226 | 226 | ||
| 227 | (ert-deftest lisp-indent-with-read-only-field () | ||
| 228 | "Test indentation on line with read-only field (Bug#32014)." | ||
| 229 | :expected-result :failed | ||
| 230 | (with-temp-buffer | ||
| 231 | (insert (propertize "prompt> " 'field 'output 'read-only t | ||
| 232 | 'rear-nonsticky t 'front-sticky '(read-only))) | ||
| 233 | (insert " foo") | ||
| 234 | (lisp-indent-line) | ||
| 235 | (should (equal (buffer-string) "prompt> foo")))) | ||
| 236 | |||
| 237 | |||
| 227 | 238 | ||
| 228 | (provide 'lisp-mode-tests) | 239 | (provide 'lisp-mode-tests) |
| 229 | ;;; lisp-mode-tests.el ends here | 240 | ;;; lisp-mode-tests.el ends here |
diff --git a/test/lisp/files-x-tests.el b/test/lisp/files-x-tests.el index 7bd69bda016..a77c6815fcd 100644 --- a/test/lisp/files-x-tests.el +++ b/test/lisp/files-x-tests.el | |||
| @@ -101,15 +101,19 @@ | |||
| 101 | (setq files-x-test--criteria | 101 | (setq files-x-test--criteria |
| 102 | (append files-x-test--application files-x-test--protocol | 102 | (append files-x-test--application files-x-test--protocol |
| 103 | files-x-test--user files-x-test--machine)) | 103 | files-x-test--user files-x-test--machine)) |
| 104 | |||
| 104 | ;; An empty variable list is accepted (but makes no sense). | 105 | ;; An empty variable list is accepted (but makes no sense). |
| 105 | (connection-local-set-profiles files-x-test--criteria) | 106 | (connection-local-set-profiles files-x-test--criteria) |
| 106 | (should-not (connection-local-get-profiles files-x-test--criteria)) | 107 | (should-not (connection-local-get-profiles files-x-test--criteria)) |
| 108 | |||
| 109 | ;; First test, all declared properties. | ||
| 107 | (connection-local-set-profiles | 110 | (connection-local-set-profiles |
| 108 | files-x-test--criteria 'remote-bash 'remote-ksh) | 111 | files-x-test--criteria 'remote-bash 'remote-ksh) |
| 109 | (should | 112 | (should |
| 110 | (equal | 113 | (equal |
| 111 | (connection-local-get-profiles files-x-test--criteria) | 114 | (connection-local-get-profiles files-x-test--criteria) |
| 112 | '(remote-bash remote-ksh))) | 115 | '(remote-bash remote-ksh))) |
| 116 | |||
| 113 | ;; Changing the order of properties doesn't matter. | 117 | ;; Changing the order of properties doesn't matter. |
| 114 | (setq files-x-test--criteria | 118 | (setq files-x-test--criteria |
| 115 | (append files-x-test--protocol files-x-test--application | 119 | (append files-x-test--protocol files-x-test--application |
| @@ -118,12 +122,14 @@ | |||
| 118 | (equal | 122 | (equal |
| 119 | (connection-local-get-profiles files-x-test--criteria) | 123 | (connection-local-get-profiles files-x-test--criteria) |
| 120 | '(remote-bash remote-ksh))) | 124 | '(remote-bash remote-ksh))) |
| 121 | ;; A further call adds profiles. | 125 | |
| 126 | ;; A further call adds profiles. | ||
| 122 | (connection-local-set-profiles files-x-test--criteria 'remote-nullfile) | 127 | (connection-local-set-profiles files-x-test--criteria 'remote-nullfile) |
| 123 | (should | 128 | (should |
| 124 | (equal | 129 | (equal |
| 125 | (connection-local-get-profiles files-x-test--criteria) | 130 | (connection-local-get-profiles files-x-test--criteria) |
| 126 | '(remote-bash remote-ksh remote-nullfile))) | 131 | '(remote-bash remote-ksh remote-nullfile))) |
| 132 | |||
| 127 | ;; Adding existing profiles doesn't matter. | 133 | ;; Adding existing profiles doesn't matter. |
| 128 | (connection-local-set-profiles | 134 | (connection-local-set-profiles |
| 129 | files-x-test--criteria 'remote-bash 'remote-nullfile) | 135 | files-x-test--criteria 'remote-bash 'remote-nullfile) |
| @@ -132,31 +138,38 @@ | |||
| 132 | (connection-local-get-profiles files-x-test--criteria) | 138 | (connection-local-get-profiles files-x-test--criteria) |
| 133 | '(remote-bash remote-ksh remote-nullfile))) | 139 | '(remote-bash remote-ksh remote-nullfile))) |
| 134 | 140 | ||
| 135 | ;; Use a criteria without application. | 141 | ;; Use different properties. |
| 136 | (setq files-x-test--criteria | 142 | (dolist (criteria |
| 137 | (append files-x-test--protocol | 143 | `(;; All properties. |
| 138 | files-x-test--user files-x-test--machine)) | 144 | ,(append files-x-test--application files-x-test--protocol |
| 139 | (connection-local-set-profiles files-x-test--criteria 'remote-ksh) | 145 | files-x-test--user files-x-test--machine) |
| 140 | (should | 146 | ;; Without :application. |
| 141 | (equal | 147 | ,(append files-x-test--protocol |
| 142 | (connection-local-get-profiles files-x-test--criteria) | 148 | files-x-test--user files-x-test--machine) |
| 143 | '(remote-ksh))) | 149 | ;; Without :protocol. |
| 144 | ;; An application not used in any registered criteria matches also this. | 150 | ,(append files-x-test--application |
| 145 | (setq files-x-test--criteria | 151 | files-x-test--user files-x-test--machine) |
| 146 | (append files-x-test--another-application files-x-test--protocol | 152 | ;; Without :user. |
| 147 | files-x-test--user files-x-test--machine)) | 153 | ,(append files-x-test--application files-x-test--protocol |
| 148 | (should | 154 | files-x-test--machine) |
| 149 | (equal | 155 | ;; Without :machine. |
| 150 | (connection-local-get-profiles files-x-test--criteria) | 156 | ,(append files-x-test--application files-x-test--protocol |
| 151 | '(remote-ksh))) | 157 | files-x-test--user) |
| 158 | ;; No property at all. | ||
| 159 | nil)) | ||
| 160 | (should | ||
| 161 | (equal | ||
| 162 | (connection-local-get-profiles criteria) | ||
| 163 | '(remote-bash remote-ksh remote-nullfile)))) | ||
| 152 | 164 | ||
| 153 | ;; Using a nil criteria also works. Duplicate profiles are trashed. | 165 | ;; Using a nil criteria also works. Duplicate profiles are trashed. |
| 154 | (connection-local-set-profiles | 166 | (connection-local-set-profiles |
| 155 | nil 'remote-bash 'remote-ksh 'remote-ksh 'remote-bash) | 167 | nil 'remote-bash 'remote-ksh 'remote-ksh 'remote-bash) |
| 168 | ;; This matches also the existing profiles from other criteria. | ||
| 156 | (should | 169 | (should |
| 157 | (equal | 170 | (equal |
| 158 | (connection-local-get-profiles nil) | 171 | (connection-local-get-profiles nil) |
| 159 | '(remote-bash remote-ksh))) | 172 | '(remote-bash remote-ksh remote-nullfile))) |
| 160 | 173 | ||
| 161 | ;; A criteria other than plist is wrong. | 174 | ;; A criteria other than plist is wrong. |
| 162 | (should-error (connection-local-set-profiles 'dummy)))) | 175 | (should-error (connection-local-set-profiles 'dummy)))) |
| @@ -235,7 +248,9 @@ | |||
| 235 | ;; declare same variables as in `remote-bash'. | 248 | ;; declare same variables as in `remote-bash'. |
| 236 | (should | 249 | (should |
| 237 | (equal connection-local-variables-alist | 250 | (equal connection-local-variables-alist |
| 238 | (nreverse (copy-tree files-x-test--variables1)))) | 251 | (append |
| 252 | (nreverse (copy-tree files-x-test--variables3)) | ||
| 253 | (nreverse (copy-tree files-x-test--variables1))))) | ||
| 239 | ;; The variables exist also as local variables. | 254 | ;; The variables exist also as local variables. |
| 240 | (should (local-variable-p 'remote-shell-file-name)) | 255 | (should (local-variable-p 'remote-shell-file-name)) |
| 241 | ;; The proper variable value is set. | 256 | ;; The proper variable value is set. |