Skip to content

Instantly share code, notes, and snippets.

@mrc
Created September 17, 2011 01:45
Show Gist options
  • Save mrc/1223517 to your computer and use it in GitHub Desktop.
Save mrc/1223517 to your computer and use it in GitHub Desktop.
ert "are" macro
(defmacro are (form &rest forms)
"Evaluate FORM, then a list of FORMS with should. If any return
nil, abort the current test as failed.
Returns the value of the last form evaluated."
(let ((result (make-symbol "result")))
`(progn
(setq ,result (should ,form))
(unless (null ',forms)
(setq ,result (are ,@forms)))
,result)))
@mrc
Copy link
Author

mrc commented Sep 17, 2011

Can be found in https://github.com/mrc/ert-extras (with tests!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment