Give assert a better failure message

This commit is contained in:
Mike Cifelli 2017-03-08 14:48:40 -05:00
parent c596d6868d
commit b47abbaad5
1 changed files with 7 additions and 3 deletions

View File

@ -16,11 +16,15 @@
(defun unit (test-suite) (defun unit (test-suite)
(apply 'and (run-test-suite test-suite))) (apply 'and (run-test-suite test-suite)))
(defun assert (comparison expected actual) (defun assert (comparison operand1 operand2)
(if (call comparison expected actual) (if (call comparison operand1 operand2)
t t
(begin (begin
(print (list expected 'is 'not comparison actual)) (print '==================================================)
(print (list comparison 'comparison 'failed))
(print operand1)
(print operand2)
(print '--------------------------------------------------)
nil))) nil)))
(defun assert= (expected actual) (defun assert= (expected actual)