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

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

Signature

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

Documentation

Return the test file for IMPL-DIR-PATH by guessing a test directory.

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

Source Code

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

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