aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTino Calancha2017-08-05 14:04:56 +0900
committerTino Calancha2017-08-05 14:20:28 +0900
commit055e2a1906a2f02c7b77537cbb4df858b00b39d9 (patch)
treec8cfbf37db8d31d2d2619ceaf0f2425ec889909a /test
parent12d7757a794edaf6ad81ee468dc99998ecf5d4ac (diff)
downloademacs-055e2a1906a2f02c7b77537cbb4df858b00b39d9.tar.gz
emacs-055e2a1906a2f02c7b77537cbb4df858b00b39d9.zip
insert-directory-wildcard-in-dir-p: Tweak regexp
This function must return non-nil for a wildcard like '/*/*.txt'. * lisp/files.el (insert-directory-wildcard-in-dir-p): Adjust regexp. * test/lisp/files-tests.el (files-tests--insert-directory-wildcard-in-dir-p): Add test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/files-tests.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 4583b1af3c3..59c1dbcbccd 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -313,5 +313,23 @@ be invoked with the right arguments."
313 `((verify-visited-file-modtime ,buffer-visiting-file) 313 `((verify-visited-file-modtime ,buffer-visiting-file)
314 (verify-visited-file-modtime nil)))))))) 314 (verify-visited-file-modtime nil))))))))
315 315
316(ert-deftest files-tests--insert-directory-wildcard-in-dir-p ()
317 (let ((alist (list (cons "/home/user/*/.txt" (cons "/home/user/" "*/.txt"))
318 (cons "/home/user/.txt" nil)
319 (cons "/home/*/.txt" (cons "/home/" "*/.txt"))
320 (cons "/home/*/" (cons "/home/" "*/"))
321 (cons "/*/.txt" (cons "/" "*/.txt"))
322 ;;
323 (cons "c:/tmp/*/*.txt" (cons "c:/tmp/" "*/*.txt"))
324 (cons "c:/tmp/*.txt" nil)
325 (cons "c:/tmp/*/" (cons "c:/tmp/" "*/"))
326 (cons "c:/*/*.txt" (cons "c:/" "*/*.txt")))))
327 (dolist (path-res alist)
328 (should
329 (equal
330 (cdr path-res)
331 (insert-directory-wildcard-in-dir-p (car path-res)))))))
332
333
316(provide 'files-tests) 334(provide 'files-tests)
317;;; files-tests.el ends here 335;;; files-tests.el ends here