X-Git-Url: http://git.kpe.io/?p=xptest.git;a=blobdiff_plain;f=xptest-example.lisp;fp=xptest-example.lisp;h=e96d0bf2bba5c5f4bd68033557ff6735cf8db669;hp=d93bae1d28afa25f348fd14e591855b611314cf4;hb=7f58715215c93f4ab9607eb940d8c0437c892252;hpb=107b5b8fb2186869d71ee99dcfe55fe871dbc43f diff --git a/xptest-example.lisp b/xptest-example.lisp index d93bae1..e96d0bf 100644 --- a/xptest-example.lisp +++ b/xptest-example.lisp @@ -59,20 +59,20 @@ (let ((result (+ (numbera test) (numberb test)))) (unless (= result 5) (failure "Result was not 5 when adding ~A and ~A" - (numbera test) (numberb test))))) + (numbera test) (numberb test))))) (defmethod subtraction-test ((test math-fixture)) (let ((result (- (numberb test) (numbera test)))) (unless (= result 1) (failure "Result was not 1 when subtracting ~A ~A" - (numberb test) (numbera test))))) + (numberb test) (numbera test))))) ;;; This method is meant to signal a failure (defmethod subtraction-test2 ((test math-fixture)) (let ((result (- (numbera test) (numberb test)))) (unless (= result 1) (failure "Result was not 1 when subtracting ~A ~A" - (numbera test) (numberb test))))) + (numbera test) (numberb test))))) ;;; Now we can create a test-suite. A test-suite contains a group of @@ -83,19 +83,19 @@ ;;; test-case. (setf math-test-suite (make-test-suite - "Math Test Suite" - "Simple test suite for arithmetic operators." - ("Addition Test" 'math-fixture - :test-thunk 'addition-test - :description "A simple test of the + operator") - ("Subtraction Test" 'math-fixture - :test-thunk 'subtraction-test - :description "A simple test of the - operator"))) + "Math Test Suite" + "Simple test suite for arithmetic operators." + ("Addition Test" 'math-fixture + :test-thunk 'addition-test + :description "A simple test of the + operator") + ("Subtraction Test" 'math-fixture + :test-thunk 'subtraction-test + :description "A simple test of the - operator"))) (add-test (make-test-case "Substraction Test 2" 'math-fixture - :test-thunk 'subtraction-test2 - :description "A broken substraction test, should fail.") - math-test-suite) + :test-thunk 'subtraction-test2 + :description "A broken substraction test, should fail.") + math-test-suite) ;;;; Finally we can run our test suite and see how it performs. ;;;; (report-result (run-test math-test-suite) :verbose t)