r5467: *** empty log message ***
[xlunit.git] / tests.lisp
index 60daebf30bd0f7de9d777e8515ac238b92dc007b..8042fe850aaeba375da5c44e609b889498aea7cc 100644 (file)
@@ -2,7 +2,7 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Id:      $Id: tests.lisp,v 1.13 2003/08/06 14:51:01 kevin Exp $
+;;;; Id:      $Id: tests.lisp,v 1.14 2003/08/08 00:57:20 kevin Exp $
 ;;;; Purpose: Self Test suite for XLUnit
 ;;;;
 ;;;; *************************************************************************
@@ -13,6 +13,9 @@
   (:export #:do-tests))
 (in-package #:xlunit-tests)
 
+(define-condition test-condition (error)
+  ())
+
 
 ;; Helper test fixture
 
 (def-test-method test-error-method ((self was-run) :run nil)
     (error "Err"))
 
+(def-test-method test-condition-without-cond ((self was-run) :run nil)
+  (assert-condition 'error (list 'no-error)))
+
+(def-test-method test-not-condition-with-cond ((self was-run) :run nil)
+  (assert-not-condition 'test-condition 
+                       (signal 'test-condition)))
+
 
 ;;; Second helper test case
 
   (assert-equal "2 run, 0 erred, 0 failed" 
                (summary (run (get-suite test-two-cases)))))
 
-(define-condition test-condition (error)
-  ())
-
 (def-test-method test-condition ((self test-case-test) :run nil)
   (assert-condition 
-   test-condition 
+   'test-condition 
    (error (make-instance 'test-condition))))
+
+(def-test-method test-condition-without-cond ((self test-case-test) 
+                                             :run nil)
+  (assert-equal "1 run, 0 erred, 1 failed"
+               (summary (run
+                         (named-test 'test-condition-without-cond
+                                     (get-suite was-run))))))
+  
+(def-test-method test-not-condition ((self test-case-test) :run nil)
+  (assert-not-condition 
+   'test-condition 
+   (progn)))
+
+(def-test-method test-not-condition-with-cond ((self test-case-test) 
+                                             :run nil)
+  (assert-equal "1 run, 0 erred, 1 failed"
+               (summary (run
+                         (named-test 'test-not-condition-with-cond
+                                     (get-suite was-run))))))
                    
 (textui-test-run (get-suite test-case-test))