From: Olof-Joachim Frahm Date: Sat, 15 Feb 2014 21:31:29 +0000 (+0100) Subject: Add IS-ALL macro. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=11becaed75e74bc430977e8488d5ff5e3ce530ff;p=fiveam.git Add IS-ALL macro. --- diff --git a/src/check.lisp b/src/check.lisp index cac6d0a..f7896c0 100644 --- a/src/check.lisp +++ b/src/check.lisp @@ -209,6 +209,10 @@ REASON-ARGS is provided, is generated based on the form of TEST: (loop for (expr value) on clauses by #'cddr collect `(is (,predicate ,expr ,value))))))) +(defmacro is-all (&body clauses) + "The input is a list of tests. Generates (is ,clause) for each one." + `(progn ,@(mapcar (lambda (clause) `(is ,clause)) clauses))) + (defmacro is-true (condition &rest reason-args) "Like IS this check generates a pass if CONDITION returns true and a failure if CONDITION returns false. Unlike IS this check diff --git a/src/package.lisp b/src/package.lisp index ccee563..e8fed83 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -43,6 +43,7 @@ ;; running checks #:is #:is-every + #:is-all #:is-true #:is-false #:signals