From 02c0931c9ff47a6740a98f6dd54dd57f70dd0dd9 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Sat, 15 Feb 2014 22:31:29 +0100 Subject: [PATCH] Add IS-ALL macro. --- src/check.lisp | 4 ++++ src/package.lisp | 1 + 2 files changed, 5 insertions(+) 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 -- 1.7.10.4