From 6be426978c86bc7a061cc66c8fda738be2e59a16 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 10 Sep 2023 07:24:34 -0700 Subject: Added :do --- README.org | 74 ++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 36 insertions(+), 38 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index e070905..cfbe780 100644 --- a/README.org +++ b/README.org @@ -72,44 +72,42 @@ You can, of course, turn testiere off too: Within the body of a ~(:tests ...)~ form are test expressions. -| Expression | Description | -|----------------------------------------------------+------------------------------------------------| -| ~(:is form)~ | The test fails if ~form~ evaluates | -| | to NIL. | -|----------------------------------------------------+------------------------------------------------| -| ~(pred form1 form2)~ | E.g ~(= (foo) 10)~ Provides more | -| | informative error messages than ~:is~ | -|----------------------------------------------------+------------------------------------------------| -| ~(:funcall function arg1 ...)~ | Calls a function with some arguments. | -| | If this function signals an error, | -| | then the test fails. Useful when | -| | running many or complex tests. | -|----------------------------------------------------+------------------------------------------------| -| ~(:fails form)~ | Evaluates ~form~ and expects it to | -| | signal an error. If it does not | -| | signal an error, the test fails. | -|----------------------------------------------------+------------------------------------------------| -| ~(:signals condition form)~ | Evaluates ~form~ and expects it to | -| | signal a condition of type | -| | ~condition~. If it does not, then | -| | the test fails. | -|----------------------------------------------------+------------------------------------------------| -| ~(:let bindings test1 ...)~ | Runs test expressions in the context | -| | of some bound variables. | -|----------------------------------------------------+------------------------------------------------| -| ~(:with-defuns ((name args body) ...) tests ... )~ | Mimics ~labels~ syntax. Used for | -| | stubbing / mocking functions will which | -| | have temporary definitions for the | -| | duration of the ~:with-defuns~ form. | -|----------------------------------------------------+------------------------------------------------| -| ~(:with-generic name methods tests ... )~ | Temporarily redefine the an entire generic | -| | function for the duration of the enclosed | -| | ~tests~. ~methods~ is a list of forms, each of | -| | is essentially anything that normally follows | -| | ~(defmethod name ...)~. | -| | E.g. ~((x string) (string-upcase x))~ or | -| | ~(:after (x string) (print "after"))~ | - +| Expression | Description | +|----------------------------------------------------+------------------------------------------------------| +| ~(:is form)~ | The test fails if ~form~ evaluates to NIL. | +|----------------------------------------------------+------------------------------------------------------| +| ~(pred form1 form2)~ | E.g ~(= (foo) 10)~ Provides more informative | +| | error messages than ~:is~ | +|----------------------------------------------------+------------------------------------------------------| +| ~(:funcall function arg1 ...)~ | Calls a function with some arguments. If this | +| | function signals an error, then the test fails. | +| | Useful when running several complext tests. | +|----------------------------------------------------+------------------------------------------------------| +| ~(:fails form)~ | Evaluates ~form~ and expects it to singal an error. | +| | If it does not signal an error, then the test fails. | +|----------------------------------------------------+------------------------------------------------------| +| ~(:signals condition form)~ | Evaluates ~form~ and expects it to signal a | +| | condition of type ~condition~. If it does not, then | +| | the test fails. | +|----------------------------------------------------+------------------------------------------------------| +| ~(:let bindings test1 ...)~ | Runs test expressions in the context of some bound | +| | variables. | +|----------------------------------------------------+------------------------------------------------------| +| ~(:with-defuns ((name args body) ...) tests ... )~ | Mimics ~labels~ syntax. Used for stubbing / mocking | +| | functions will which have temporary definitions for | +| | the duration of the ~:with-defuns~ form. | +|----------------------------------------------------+------------------------------------------------------| +| ~(:with-generic name methods tests ... )~ | Temporarily redefine the an entire generic | +| | function for the duration of the enclosed | +| | ~tests~. ~methods~ is a list of forms, each of | +| | is essentially anything that normally follows | +| | ~(defmethod name ...)~. | +| | E.g. ~((x string) (string-upcase x))~ or | +| | ~(:after (x string) (print "after"))~ | +|----------------------------------------------------+------------------------------------------------------| +| ~(:do form)~ | Evaluate ~form~ for its side effects. Useful | +| | within a ~:let~, ~:with-defuns~, or ~:with-generic~ | +| | | ** Examples #+begin_src lisp -- cgit v1.2.3