Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502 committed Sep 2, 2023
1 parent 95260d2 commit 3ad2671
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/integration/apheleia-it.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@
"Run STEPS from defined integration test.
This is a list that can appear in `:steps'. For supported steps,
see the implementation below, or example tests. CALLBACK will be
invoked, with no arguments, after the steps are run. This could
be synchronous or asynchronous. BINDINGS is a `let'-style list of
lexical bindings that will be available for `eval' steps."
invoked, with nil or an error, after the steps are run. This
could be synchronous or asynchronous. BINDINGS is a `let'-style
list of lexical bindings that will be available for `eval'
steps."
(pcase steps
(`nil (funcall callback))
(`((insert ,str) . ,rest)
(insert str)
(apheleia-it--run-test-steps rest callback bindings))
(`((with-callback ,callback . ,body) . ,rest)
(apheleia-it--run-test-steps
body
Expand All @@ -61,7 +59,12 @@ lexical bindings that will be available for `eval' steps."
(eval
`(let (,@bindings)
,form))
(funcall callback))))
(funcall callback))
(`((insert ,str) . ,rest)
(insert str)
(apheleia-it--run-test-steps rest callback bindings))
(`((expect ,str) . ,rest)
)))

(defun apheleia-it-run-test (name)
"Run a single unit test. Return non-nil if passed, nil if failed."
Expand Down

0 comments on commit 3ad2671

Please sign in to comment.