(string-match-p "spec" file))))
(defun my/matching-test-file-p (test-file base-name extension)
- (let ((found nil))
- (dolist (pattern (list
- (concat "test/.*" base-name "[^/]*\\." extension "$")
- (concat "spec/.*" base-name "[^/]*\\." extension "$")
- (concat "test[^/]*" base-name "[^/]*\\." extension "$")
- (concat base-name "[^/]*test\\." extension "$")
- (concat base-name "[^/]*spec\\." extension "$")))
- (if (string-match-p pattern test-file)
- (setq found t)))
- found))
+ (cl-loop for pattern in (list
+ (concat "test/.*" base-name "[^/]*\\." extension "$")
+ (concat "spec/.*" base-name "[^/]*\\." extension "$")
+ (concat "test[^/]*" base-name "[^/]*\\." extension "$")
+ (concat base-name "[^/]*test\\." extension "$")
+ (concat base-name "[^/]*spec\\." extension "$"))
+ for matched = (string-match-p pattern test-file)
+ until matched
+ finally return (not (null matched))))
(defun my/matching-prod-file-p (prod-file base-name extension)
(dolist (pattern '("test" "spec" "^\\.*" "\\.*$"))