Function: ert-test-location

ert-test-location is a byte-compiled function defined in ert.el.gz.

Signature

(ert-test-location TEST)

Documentation

Return a string description the source location of TEST.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/ert.el.gz
(defun ert-test-location (test)
  "Return a string description the source location of TEST."
  (when-let* ((loc
               (ignore-errors
                 (find-function-search-for-symbol
                  (ert-test-name test) 'ert--test (ert-test-file-name test)))))
    (let* ((buffer (car loc))
           (point (cdr loc))
           (file (file-relative-name (buffer-file-name buffer)))
           (line (with-current-buffer buffer
                   (line-number-at-pos point))))
      (format "at %s:%s" file line))))