Function: cider-test--extract-from-actual

cider-test--extract-from-actual is a byte-compiled function defined in cider-test.el.

Signature

(cider-test--extract-from-actual ACTUAL N)

Documentation

Extract form N from ACTUAL, ignoring outermost not.

ACTUAL is a string like "(not (= 3 4))", of the sort returned by clojure.test.

N = 1 => 3, N = 2 => 4, etc.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-test.el
(defun cider-test--extract-from-actual (actual n)
  "Extract form N from ACTUAL, ignoring outermost not.

ACTUAL is a string like \"(not (= 3 4))\", of the sort returned by
clojure.test.

N = 1 => 3, N = 2 => 4, etc."
  (with-temp-buffer
    (insert actual)
    (clojure-mode)
    (goto-char (point-min))
    (re-search-forward "(" nil t 2)
    (clojure-forward-logical-sexp n)
    (forward-whitespace 1)
    (let ((beg (point)))
      (clojure-forward-logical-sexp)
      (buffer-substring beg (point)))))