Function: projectile--test-to-impl-dir
projectile--test-to-impl-dir is a byte-compiled function defined in
projectile.el.
Signature
(projectile--test-to-impl-dir TEST-DIR-PATH)
Documentation
Return the directory path of an impl file with test file in TEST-DIR-PATH.
Occurrences of the current project type's test-dir property (which should be a
string) are replaced with the current project type's src-dir property
(which should be a string) to obtain the new directory.
Nil is returned if either the src-dir or test-dir properties are not strings.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile--test-to-impl-dir (test-dir-path)
"Return the directory path of an impl file with test file in TEST-DIR-PATH.
Occurrences of the current project type's test-dir property (which should be a
string) are replaced with the current project type's src-dir property
(which should be a string) to obtain the new directory.
Nil is returned if either the src-dir or test-dir properties are not strings."
(let* ((project-type (projectile-project-type))
(test-dir (projectile-test-directory project-type))
(impl-dir (projectile-src-directory project-type)))
(when (and (stringp test-dir) (stringp impl-dir))
(if (not (string-match-p test-dir (file-name-directory test-dir-path)))
(error "Attempted to find a implementation file by switching this project type's (%s) test-dir property \"%s\" with this project type's src-dir property \"%s\", but %s does not contain \"%s\""
project-type test-dir impl-dir test-dir-path test-dir)
(projectile-complementary-dir test-dir-path test-dir impl-dir)))))