Skip to content

Commit

Permalink
Clarify that buttercup--wrap-expr is only meant for expect
Browse files Browse the repository at this point in the history
The butercup--wrap-expr function was extracted from the expect macro
to reduce code repetition in that macro definition.  It will not
produce a function when used outside that - or possibly other - macros.
  • Loading branch information
snogge committed Sep 4, 2024
1 parent 9bb00a2 commit 19e1a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
(define-error 'buttercup-pending "Buttercup test is pending" 'buttercup-error-base)

(defun buttercup--wrap-expr (expr)
"Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'."
"Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'.
This function is only usable from within the buttercup `expect' macro."
(if (fboundp 'oclosure-lambda) ;Emacs≥29
`(oclosure-lambda (buttercup--thunk (expr ',expr)) ()
,expr)
Expand Down

0 comments on commit 19e1a86

Please sign in to comment.