Skip to content

Commit

Permalink
Improve the docstring of the expect macro
Browse files Browse the repository at this point in the history
  • Loading branch information
snogge committed Sep 4, 2024
1 parent 6ecee3c commit d30f6a3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions buttercup.el
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,19 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
(defmacro expect (arg &optional matcher &rest args)
"Expect a condition to be true.
This macro knows three forms:
This macro knows two forms:
\(expect ARG :MATCHER ARGS...)
Fail the current test if the matcher does not match these arguments.
\(expect ARG :MATCHER [ARGS...])
Fail the current test if the MATCHER does not match these arguments.
The correct number of arguments depend on the MATCHER.
See `buttercup-define-matcher' for more information on matchers.
\(expect (function ARG...))
Fail the current test if the function call does not return a true value.
\(expect ARG)
Fail the current test if ARG is not true."
Fail the current test if ARG is not true.
This is the same as (expect ARG :to-be-truthy).
All arguments can be a value or a single Lisp form. The evaluation of
the arguments is delayed until the containing spec is executed."
`(buttercup-expect ,(buttercup--wrap-expr arg)
,(or matcher :to-be-truthy)
,@(mapcar #'buttercup--wrap-expr args)))
Expand Down

0 comments on commit d30f6a3

Please sign in to comment.