X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=t%2Ftests.lisp;h=0aca3e50bea9d95ed794b9ddd55bce9fe1ca9c9d;hb=462b14619b0b482847197689752651da0833b391;hp=77909f56c5cccd74d117187153ec6834e7f60193;hpb=c832bdccbc2c363b1a6714e70905721bd8c4d7c1;p=fiveam.git diff --git a/t/tests.lisp b/t/tests.lisp index 77909f5..0aca3e5 100644 --- a/t/tests.lisp +++ b/t/tests.lisp @@ -10,6 +10,9 @@ `(let ((,results (with-*test-dribble* nil (run ',test-name)))) ,@body)) +(def-fixture null-fixture () + `(progn ,@(&body))) + ;;;; Test the checks (test (is1 :suite test-suite) @@ -20,7 +23,7 @@ (is-true t) (is-false nil)) -(test (is2 :suite test-suite) +(test (is2 :suite test-suite :fixture null-fixture) (is (plusp 0)) (is (< 0 -1)) (is (not (plusp 1))) @@ -28,7 +31,7 @@ (is-true nil) (is-false t)) -(test is +(test (is :profile t) (with-test-results (results is1) (is (= 6 (length results))) (is (every #'test-passed-p results))) @@ -146,6 +149,37 @@ (signals circular-dependency (run 'circular-2))) +;;;; dependencies with symbol +(test (dep-with-symbol-first :suite test-suite) + (pass)) + +(test (dep-with-symbol-dependencies-not-met :depends-on (not dep-with-symbol-first) + :suite test-suite) + (fail "Error in the test of the test, this should not ever happen")) + +(test (dep-with-symbol-depends-on-ok :depends-on dep-with-symbol-first :suite test-suite) + (pass)) + +(test (dep-with-symbol-depends-on-failed-dependency :depends-on dep-with-symbol-dependencies-not-met + :suite test-suite) + (fail "No, I should not be tested becuase I depend on a test that in its turn has a failed dependecy.")) + +(test dependencies-with-symbol + (with-test-results (results dep-with-symbol-first) + (is (some #'test-passed-p results))) + + (with-test-results (results dep-with-symbol-depends-on-ok) + (is (some #'test-passed-p results))) + + (with-test-results (results dep-with-symbol-dependencies-not-met) + (is (some #'test-skipped-p results))) + + (with-test-results (results dep-with-symbol-depends-on-failed-dependency) + (is (some #'test-skipped-p results)))) + + +;;;; test for-all + (test gen-integer (for-all ((a (gen-integer))) (is (integerp a))))