Function: hypb-ert-def-at-p

hypb-ert-def-at-p is a byte-compiled function defined in hypb-ert.el.

Signature

(hypb-ert-def-at-p &optional START-END-FLAG)

Documentation

Return test name if on the name in the first line of an ert test def.

With optional START-END-FLAG, return a list of (test-name start-pos end-pos).

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hypb-ert.el
;; The following expression is true only when an ert-deftest has been
;; instrumented by edebug:
;; (memq 'edebug-enter (flatten-tree (ert-test-body (ert-get-test test-sym))))

(defun hypb-ert-def-at-p (&optional start-end-flag)
  "Return test name if on the name in the first line of an ert test def.
With optional START-END-FLAG, return a list of (test-name start-pos end-pos)."
  (unless (or (eolp)
	      (memq (char-after (point))
		    '(?\( ?\) ?\[ ?\] ?{ ?} ?< ?>)))
    (save-excursion
      (beginning-of-line)
      (when (looking-at (concat "(ert-deftest\\(-async\\)?[ \t]+"
				"\\(" lisp-mode-symbol-regexp "\\)"
				"\\s-*("))
	(if start-end-flag
	    (list (match-string-no-properties 2) (match-beginning 2) (match-end 2))
	  (match-string-no-properties 2))))))