Skip to content

Commit 4accc65

Browse files
committed
Documents the clojure-test-(implementation-)for-fn functions.
1 parent 5b057dc commit 4accc65

File tree

2 files changed

+33
-22
lines changed

2 files changed

+33
-22
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,22 @@ current buffer with <kbd>C-c C-,</kbd>. Failing tests and errors will be
6565
highlighted using overlays. To clear the overlays, use <kbd>C-c k</kbd>.
6666

6767
You can jump between implementation and test files with <kbd>C-c C-t</kbd> if
68-
your project is laid out in a way that clojure-test-mode expects. Your
69-
project root should have a `src/` directory containing files that
70-
correspond to their namespace. It should also have a `test/` directory
71-
containing files that correspond to their namespace, and the test
72-
namespaces should mirror the implementation namespaces with the
73-
addition of "-test" as the suffix to the last segment of the namespace.
74-
75-
So `my.project.frob` would be found in `src/my/project/frob.clj` and
76-
its tests would be in `test/my/project/frob_test.clj` in the
77-
`my.project.frob-test` namespace.
68+
your project is laid out in a way that clojure-test-mode expects. Your project
69+
root should have a `src/` directory containing files that correspond to their
70+
namespace. It should also have a `test/` directory containing files that
71+
correspond to their namespace, and the test namespaces should mirror the
72+
implementation namespaces with the addition of "-test" as the suffix to the last
73+
segment of the namespace.
74+
75+
So `my.project.frob` would be found in `src/my/project/frob.clj` and its tests
76+
would be in `test/my/project/frob_test.clj` in the `my.project.frob-test`
77+
namespace.
78+
79+
This behavior can also be overridden by setting `clojure-test-for-fn` and
80+
`clojure-test-implementation-for-fn` with functions of your choosing.
81+
`clojure-test-for-fn` takes an implementation namespace and returns the full
82+
path of the test file. `clojure-test-implementation-for-fn` takes a test
83+
namespace and returns the full path for the implementation file.
7884

7985
## Paredit
8086

clojure-test-mode.el

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,23 @@
2222
;; current buffer with C-c C-,. Failing tests and errors will be
2323
;; highlighted using overlays. To clear the overlays, use C-c k.
2424

25-
;; You can jump between implementation and test files with C-c t if
26-
;; your project is laid out in a way that clojure-test-mode
27-
;; expects. Your project root should have a src/ directory containing
28-
;; files that correspond to their namespace. It should also have a
29-
;; test/ directory containing files that correspond to their
30-
;; namespace, and the test namespaces should mirror the implementation
31-
;; namespaces with the addition of "test" as the second-to-last
32-
;; segment of the namespace.
33-
34-
;; So my.project.frob would be found in src/my/project/frob.clj and
35-
;; its tests would be in test/my/project/test/frob.clj in the
36-
;; my.project.test.frob namespace.
25+
;; You can jump between implementation and test files with <kbd>C-c C-t</kbd> if
26+
;; your project is laid out in a way that clojure-test-mode expects. Your
27+
;; project root should have a `src/` directory containing files that correspond
28+
;; to their namespace. It should also have a `test/` directory containing files
29+
;; that correspond to their namespace, and the test namespaces should mirror the
30+
;; implementation namespaces with the addition of "-test" as the suffix to the
31+
;; last segment of the namespace.
32+
33+
;; So `my.project.frob` would be found in `src/my/project/frob.clj` and its
34+
;; tests would be in `test/my/project/frob_test.clj` in the
35+
;; `my.project.frob-test` namespace.
36+
37+
;; This behavior can also be overridden by setting `clojure-test-for-fn` and
38+
;; `clojure-test-implementation-for-fn` with functions of your choosing.
39+
;; `clojure-test-for-fn` takes an implementation namespace and returns the full
40+
;; path of the test file. `clojure-test-implementation-for-fn` takes a test
41+
;; namespace and returns the full path for the implementation file.
3742

3843
;;; History:
3944

0 commit comments

Comments
 (0)