ls-lisp-support-shell-wildcards)
(string-match (concat "[" wildcards "]") (file-name-directory dir))
(not (file-exists-p dir))) ; Prefer an existing file to wildcards.
- (let ((regexp (format "\\`\\([^%s]+/\\)\\([^%s]*[%s].*\\)"
+ (let ((regexp (format "\\`\\([^%s]*/\\)\\([^%s]*[%s].*\\)"
wildcards wildcards wildcards)))
(string-match regexp dir)
(cons (match-string 1 dir) (match-string 2 dir))))))
`((verify-visited-file-modtime ,buffer-visiting-file)
(verify-visited-file-modtime nil))))))))
+(ert-deftest files-tests--insert-directory-wildcard-in-dir-p ()
+ (let ((alist (list (cons "/home/user/*/.txt" (cons "/home/user/" "*/.txt"))
+ (cons "/home/user/.txt" nil)
+ (cons "/home/*/.txt" (cons "/home/" "*/.txt"))
+ (cons "/home/*/" (cons "/home/" "*/"))
+ (cons "/*/.txt" (cons "/" "*/.txt"))
+ ;;
+ (cons "c:/tmp/*/*.txt" (cons "c:/tmp/" "*/*.txt"))
+ (cons "c:/tmp/*.txt" nil)
+ (cons "c:/tmp/*/" (cons "c:/tmp/" "*/"))
+ (cons "c:/*/*.txt" (cons "c:/" "*/*.txt")))))
+ (dolist (path-res alist)
+ (should
+ (equal
+ (cdr path-res)
+ (insert-directory-wildcard-in-dir-p (car path-res)))))))
+
+
(provide 'files-tests)
;;; files-tests.el ends here