RosettaCodeData/Task/Assertions/EchoLisp/assertions.l

10 lines
437 B
Common Lisp
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(assert (integer? 42)) #t ;; success returns true
;; error and return to top level if not true;
(assert (integer? 'quarante-deux))
error: assert : assertion failed : (#integer? 'quarante-deux)
;; assertion with message (optional)
(assert (integer? 'quarante-deux) "☝️ expression must evaluate to the integer 42")
💥 error: expression must evaluate to the integer 42 : assertion failed : (#integer? 'quarante-deux)