Skip to content

Commit 3dd9396

Browse files
committed
Fix failing cider-expected-ns test on windows
In cider-expected-ns, a test was providing a `path` of "/a/foo/bar/baz_utils.clj" when `cider-classpath-entries had a value of `'("/a" "/b" "/c" "/c/inner" "/base/clj" "/base/clj-dev")` The tests expects the cider-classpath to be picked up in `cider-expected-ns` and drop the `/a` prefix from the generated namespaced, leaving `foo.bar.baz-utils` This was not happening on windows because cider-expected-ns was first calling `file-truename` on `path`, which prefixed the path with the drive name. This caused the `file-in-directory-p` check to start failing because "z:/a/foo/..." is not considered to be in `"/a"` on windows. This made cider think that the `path` was not located anywhere on the current classpath. Mapping over all the directories with `file-truename` fixes this on windows, and should also be a safe operation on sane operating systems. I am not sure how clojure-ts-mode changes caused this bug, or surfaced it.
1 parent 8a77695 commit 3dd9396

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Eldev

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
(defvar clojure-ts-failing-tests
1616
(when (member system-type '(ms-dos windows-nt cygwin))
17-
'("./test/cider-client-tests.el"
18-
"./test/cider-eval-tests.el"))
17+
'("./test/cider-eval-tests.el"))
1918
"Tests that fail when running against clojure-ts-mode. These need to be fixed.
2019
See 'cider-expected-ns returns the namespace matching the given string path'
2120
and 'cider-provide-file can handle multibyte characters'

cider-client.el

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ nREPL connection."
154154
(relpath (thread-last
155155
(cider-classpath-entries)
156156
(seq-filter #'file-directory-p)
157+
(seq-map #'file-truename)
157158
(seq-map (lambda (dir)
158159
(when (file-in-directory-p path dir)
159160
(file-relative-name path dir))))

0 commit comments

Comments
 (0)