Give assert a better failure message
This commit is contained in:
parent
c596d6868d
commit
b47abbaad5
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue