diff options
author | jao <jao@gnu.org> | 2025-08-01 02:44:12 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-08-01 02:44:12 +0100 |
commit | 59f035668d482f37b8af8857cdee650d5fe8ed31 (patch) | |
tree | eb25ebf0579c4bca8cf37a3ea51be60b3f326a46 | |
parent | 89f93d3d052f1dfa37e611d62e628b647fa1f7a1 (diff) | |
download | elibs-59f035668d482f37b8af8857cdee650d5fe8ed31.tar.gz elibs-59f035668d482f37b8af8857cdee650d5fe8ed31.tar.bz2 |
cider + kaocha
-rw-r--r-- | init.el | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -2202,6 +2202,26 @@ (setq mode-name "λ")) :hook (clojure-mode . jao-clojure--fix-things)) +(defun jao-cider-test-ns (ns) + (let ((parts (string-split ns "\\."))) + (if (string= "test" (cadr parts)) + ns + (mapconcat #'identity (cons (car parts) (cons "test" (cdr parts))) ".")))) + +(defun jao-kaocha-file-name () + (let* ((filename (match-string 2)) + (path (replace-regexp-in-string "\\." "/" (match-string 1)))) + (substring-no-properties (concat "test/" path filename)))) + +(defconst jao-kaocha-compilation-error + '(kaocha-error "^FAIL in \\(.+\\.\\)[^ ]+ (\\([^:]+\\.clj[cs]?\\):\\([0-9]+\\))" + jao-kaocha-file-name 3)) + +(use-package compile + :config + (add-to-list 'compilation-error-regexp-alist-alist + jao-kaocha-compilation-error)) + (use-package cider :ensure t :commands cider-mode @@ -2220,6 +2240,7 @@ cider-repl-use-pretty-printing t cider-show-error-buffer 'except-in-repl cider-test-show-report-on-success nil + cider-test-infer-test-ns #'jao-cider-test-ns cider-use-fringe-indicators nil cider-use-overlays nil clojure-docstring-fill-column 72 |