diff options
| author | Michael Albinus | 2017-07-30 13:08:36 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-07-30 13:08:36 +0200 |
| commit | 65d428228bb57ce434a8eb5a4eeb2274171586b8 (patch) | |
| tree | f3ef733d31507c72cea3682517f74319d04e45a2 | |
| parent | 4219240e1df6abbd842f4474fe7862f341cc355a (diff) | |
| download | emacs-65d428228bb57ce434a8eb5a4eeb2274171586b8.tar.gz emacs-65d428228bb57ce434a8eb5a4eeb2274171586b8.zip | |
* test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards): New test.
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 104 |
1 files changed, 103 insertions, 1 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 4ae7b880245..979f674f0f1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2202,6 +2202,108 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 2202 | ;; Cleanup. | 2202 | ;; Cleanup. |
| 2203 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) | 2203 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) |
| 2204 | 2204 | ||
| 2205 | (ert-deftest tramp-test17-dired-with-wildcards () | ||
| 2206 | "Check `dired' with wildcards." | ||
| 2207 | (skip-unless (tramp--test-enabled)) | ||
| 2208 | (skip-unless (fboundp 'insert-directory-wildcard-in-dir-p)) | ||
| 2209 | |||
| 2210 | (dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | ||
| 2211 | (let* ((tmp-name1 | ||
| 2212 | (expand-file-name (tramp--test-make-temp-name nil quoted))) | ||
| 2213 | (tmp-name2 | ||
| 2214 | (expand-file-name (tramp--test-make-temp-name nil quoted))) | ||
| 2215 | (tmp-name3 (expand-file-name "foo" tmp-name1)) | ||
| 2216 | (tmp-name4 (expand-file-name "bar" tmp-name2)) | ||
| 2217 | (tramp-test-temporary-file-directory | ||
| 2218 | (funcall | ||
| 2219 | (if quoted 'tramp-compat-file-name-quote 'identity) | ||
| 2220 | tramp-test-temporary-file-directory)) | ||
| 2221 | buffer) | ||
| 2222 | (unwind-protect | ||
| 2223 | (progn | ||
| 2224 | (make-directory tmp-name1) | ||
| 2225 | (write-region "foo" nil tmp-name3) | ||
| 2226 | (should (file-directory-p tmp-name1)) | ||
| 2227 | (should (file-exists-p tmp-name3)) | ||
| 2228 | (make-directory tmp-name2) | ||
| 2229 | (write-region "foo" nil tmp-name4) | ||
| 2230 | (should (file-directory-p tmp-name2)) | ||
| 2231 | (should (file-exists-p tmp-name4)) | ||
| 2232 | |||
| 2233 | ;; Check for expanded directory names. | ||
| 2234 | (with-current-buffer | ||
| 2235 | (setq buffer | ||
| 2236 | (dired-noselect | ||
| 2237 | (expand-file-name | ||
| 2238 | "tramp-test*" tramp-test-temporary-file-directory))) | ||
| 2239 | (goto-char (point-min)) | ||
| 2240 | (should | ||
| 2241 | (re-search-forward | ||
| 2242 | (regexp-quote | ||
| 2243 | (file-relative-name | ||
| 2244 | tmp-name1 tramp-test-temporary-file-directory)))) | ||
| 2245 | (goto-char (point-min)) | ||
| 2246 | (should | ||
| 2247 | (re-search-forward | ||
| 2248 | (regexp-quote | ||
| 2249 | (file-relative-name | ||
| 2250 | tmp-name2 tramp-test-temporary-file-directory))))) | ||
| 2251 | (kill-buffer buffer) | ||
| 2252 | |||
| 2253 | ;; Check for expanded directory and file names. | ||
| 2254 | (with-current-buffer | ||
| 2255 | (setq buffer | ||
| 2256 | (dired-noselect | ||
| 2257 | (expand-file-name | ||
| 2258 | "tramp-test*/*" tramp-test-temporary-file-directory))) | ||
| 2259 | (goto-char (point-min)) | ||
| 2260 | (should | ||
| 2261 | (re-search-forward | ||
| 2262 | (regexp-quote | ||
| 2263 | (file-relative-name | ||
| 2264 | tmp-name3 tramp-test-temporary-file-directory)))) | ||
| 2265 | (goto-char (point-min)) | ||
| 2266 | (should | ||
| 2267 | (re-search-forward | ||
| 2268 | (regexp-quote | ||
| 2269 | (file-relative-name | ||
| 2270 | tmp-name4 | ||
| 2271 | tramp-test-temporary-file-directory))))) | ||
| 2272 | (kill-buffer buffer) | ||
| 2273 | |||
| 2274 | ;; Check for special characters. | ||
| 2275 | (setq tmp-name3 (expand-file-name "*?" tmp-name1)) | ||
| 2276 | (setq tmp-name4 (expand-file-name "[a-z0-9]" tmp-name2)) | ||
| 2277 | (write-region "foo" nil tmp-name3) | ||
| 2278 | (should (file-exists-p tmp-name3)) | ||
| 2279 | (write-region "foo" nil tmp-name4) | ||
| 2280 | (should (file-exists-p tmp-name4)) | ||
| 2281 | |||
| 2282 | (with-current-buffer | ||
| 2283 | (setq buffer | ||
| 2284 | (dired-noselect | ||
| 2285 | (expand-file-name | ||
| 2286 | "tramp-test*/*" tramp-test-temporary-file-directory))) | ||
| 2287 | (goto-char (point-min)) | ||
| 2288 | (should | ||
| 2289 | (re-search-forward | ||
| 2290 | (regexp-quote | ||
| 2291 | (file-relative-name | ||
| 2292 | tmp-name3 tramp-test-temporary-file-directory)))) | ||
| 2293 | (goto-char (point-min)) | ||
| 2294 | (should | ||
| 2295 | (re-search-forward | ||
| 2296 | (regexp-quote | ||
| 2297 | (file-relative-name | ||
| 2298 | tmp-name4 | ||
| 2299 | tramp-test-temporary-file-directory))))) | ||
| 2300 | (kill-buffer buffer)) | ||
| 2301 | |||
| 2302 | ;; Cleanup. | ||
| 2303 | (ignore-errors (kill-buffer buffer)) | ||
| 2304 | (ignore-errors (delete-directory tmp-name1 'recursive)) | ||
| 2305 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | ||
| 2306 | |||
| 2205 | (ert-deftest tramp-test18-file-attributes () | 2307 | (ert-deftest tramp-test18-file-attributes () |
| 2206 | "Check `file-attributes'. | 2308 | "Check `file-attributes'. |
| 2207 | This tests also `file-readable-p', `file-regular-p' and | 2309 | This tests also `file-readable-p', `file-regular-p' and |
| @@ -3812,11 +3914,11 @@ process sentinels. They shall not disturb each other." | |||
| 3812 | (tramp--test-message | 3914 | (tramp--test-message |
| 3813 | "Trace 2 action %d %s %s" count buf (current-time-string)) | 3915 | "Trace 2 action %d %s %s" count buf (current-time-string)) |
| 3814 | (accept-process-output proc 0.1 nil 0) | 3916 | (accept-process-output proc 0.1 nil 0) |
| 3815 | ;; Regular operation. | ||
| 3816 | (tramp--test-message | 3917 | (tramp--test-message |
| 3817 | "Trace 3 action %d %s %s" count buf (current-time-string)) | 3918 | "Trace 3 action %d %s %s" count buf (current-time-string)) |
| 3818 | ;; Give the watchdog a chance. | 3919 | ;; Give the watchdog a chance. |
| 3819 | (read-event nil nil 0.01) | 3920 | (read-event nil nil 0.01) |
| 3921 | ;; Regular operation. | ||
| 3820 | (if (= count 2) | 3922 | (if (= count 2) |
| 3821 | (if (= (length buffers) 1) | 3923 | (if (= (length buffers) 1) |
| 3822 | (tramp--test-instrument-test-case 10 | 3924 | (tramp--test-instrument-test-case 10 |