Function: projectile--test-to-impl-dir-fallback

projectile--test-to-impl-dir-fallback is a byte-compiled function defined in projectile.el.

Signature

(projectile--test-to-impl-dir-fallback TEST-DIR-PATH)

Documentation

Return the impl file for TEST-DIR-PATH by guessing a source directory.

Occurrences of projectile-default-test-directory in the directory of TEST-DIR-PATH are replaced with projectile-default-src-directory. Nil is returned if projectile-default-test-directory is not a substring of TEST-DIR-PATH.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile--test-to-impl-dir-fallback (test-dir-path)
  "Return the impl file for TEST-DIR-PATH by guessing a source directory.

Occurrences of `projectile-default-test-directory' in the directory of
TEST-DIR-PATH are replaced with `projectile-default-src-directory'.  Nil is
returned if `projectile-default-test-directory' is not a substring of
TEST-DIR-PATH."
  (when-let* ((file (projectile--complementary-file
                    test-dir-path
                    (lambda (f)
                      (when (string-match-p projectile-default-test-directory f)
                        (projectile-complementary-dir
                         test-dir-path
                         projectile-default-test-directory
                         projectile-default-src-directory)))
                    #'projectile--impl-name-for-test-name)))
    (file-relative-name file (projectile-project-root))))