Skip to content

Commit

Permalink
Move a bit of related code together
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Nov 27, 2023
1 parent 120fd88 commit 0134a0b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions cider-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ to work against the correct REPL session.")
"When theme is changed, update `cider-test-items-background-color'."
(setq cider-test-items-background-color (cider-scale-background-color)))

(defun cider-test-toggle-fail-fast ()
"Toggles `cider-test-fail-fast' t <-> nil for the current buffer."
(interactive)
(setq-local cider-test-fail-fast (not cider-test-fail-fast)))

;;; Report mode & key bindings
;;
;; The primary mode of interacting with test results is the report buffer, which
Expand Down Expand Up @@ -368,6 +363,16 @@ With the actual value, the outermost '(not ...)' s-expression is removed."

;;; Report rendering

(defcustom cider-test-fail-fast t
"Controls whether to stop a test run on failure/error."
:type 'boolean
:package-version '(cider . "1.8.0"))

(defun cider-test-toggle-fail-fast ()
"Toggles `cider-test-fail-fast' t <-> nil for the current buffer."
(interactive)
(setq-local cider-test-fail-fast (not cider-test-fail-fast)))

(defun cider-test-type-face (type)
"Return the font lock face for the test result TYPE."
(pcase type
Expand All @@ -382,7 +387,9 @@ With the actual value, the outermost '(not ...)' s-expression is removed."
`(:foreground ,(face-attribute face :background))))

(defun cider-test-render-summary (buffer summary &optional elapsed-time)
"Emit into BUFFER the report SUMMARY statistics."
"Emit into BUFFER the report SUMMARY statistics.
If ELAPSED-TIME is provided it will be included in the summary."
(with-current-buffer buffer
(nrepl-dbind-response summary (ns var test pass fail error)
(let ((ms (nrepl-dict-get elapsed-time "ms")))
Expand Down Expand Up @@ -689,11 +696,6 @@ The selectors can be either keywords or strings."
(split-string
(cider-read-from-minibuffer message))))

(defcustom cider-test-fail-fast t
"Controls whether to stop a test run on failure/error."
:type 'boolean
:package-version '(cider . "1.8.0"))

(defun cider-test-execute (ns &optional tests silent prompt-for-filters)
"Run tests for NS, which may be a keyword, optionally specifying TESTS.
This tests a single NS, or multiple namespaces when using keywords `:project',
Expand Down

0 comments on commit 0134a0b

Please sign in to comment.