From b47abbaad5a533a6e1906a975f49938124f977c3 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Wed, 8 Mar 2017 14:48:40 -0500 Subject: [PATCH] Give assert a better failure message --- lisp/unit/unit-test.lisp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/unit/unit-test.lisp b/lisp/unit/unit-test.lisp index ae09b09..4a5ca1f 100644 --- a/lisp/unit/unit-test.lisp +++ b/lisp/unit/unit-test.lisp @@ -16,11 +16,15 @@ (defun unit (test-suite) (apply 'and (run-test-suite test-suite))) -(defun assert (comparison expected actual) - (if (call comparison expected actual) +(defun assert (comparison operand1 operand2) + (if (call comparison operand1 operand2) t (begin - (print (list expected 'is 'not comparison actual)) + (print '==================================================) + (print (list comparison 'comparison 'failed)) + (print operand1) + (print operand2) + (print '--------------------------------------------------) nil))) (defun assert= (expected actual)