X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests.lisp;h=f4b3ce079f78f95517061dcd8c4f715cdc046ec9;hb=e9a26631dd34230ee2a06d8c850376ad5276c21e;hp=eebaf13efaf1910aaab907ce3d37dc56b4f02d60;hpb=aa610805927518a648eb0da6a8713cd0a83337df;p=kmrcl.git diff --git a/tests.lisp b/tests.lisp index eebaf13..f4b3ce0 100644 --- a/tests.lisp +++ b/tests.lisp @@ -7,7 +7,7 @@ ;;;; Author: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: tests.lisp,v 1.1 2003/04/28 21:12:27 kevin Exp $ +;;;; $Id: tests.lisp,v 1.3 2003/04/29 00:23:21 kevin Exp $ ;;;; ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg ;;;; @@ -17,29 +17,68 @@ (:use #:kmrcl #:cl #:rtest)) (in-package #:kmrcl-tests) +(rem-all-tests) + + +(when (find-package '#:kmr-mop) + (pushnew :kmrtest-mop cl:*features*)) + (deftest p1 t t) -#+kmrcl-mop +(deftest str.0 (substitute-chars-strings "" nil) "") +(deftest str.1 (substitute-chars-strings "abcd" nil) "abcd") +(deftest str.2 (substitute-chars-strings "abcd" nil) "abcd") +(deftest str.3 (substitute-chars-strings "abcd" '((#\j . "ef"))) "abcd") +(deftest str.4 (substitute-chars-strings "abcd" '((#\a . "ef"))) "efbcd") +(deftest str.5 + (substitute-chars-strings "abcd" '((#\a . "ef") (#\j . "ghi"))) + "efbcd") +(deftest str.6 + (substitute-chars-strings "abcd" '((#\a . "ef") (#\d . "ghi"))) + "efbcghi") + +(deftest str.7 (escape-xml-string "") "") +(deftest str.8 (escape-xml-string "abcd") "abcd") +(deftest str.9 (escape-xml-string "ab&cd") "ab&cd") +(deftest str.10 (escape-xml-string "ab&cd<") "ab&cd<") +(deftest str.11 (escape-xml-string "ab&c><") "ab&c><") + +#+kmrtest-mop (progn (defclass credit-rating () ((level :attributes (date-set time-set)) (id :attributes (person-setting))) - (:metaclass kmrcl:attributes-class)) - (defparameter cr (make-instance 'credit-rating)) + (:metaclass attributes-class)) + (defparameter cr nil) + + (defclass monitored-credit-rating (credit-rating) + ((level :attributes (last-checked interval date-set)) + (cc :initarg :cc) + (id :attributes (verified))) + (:metaclass attributes-class)) + (defparameter mcr (make-instance 'monitored-credit-rating)) + + (deftest attrib.mop.1 + (progn + (setq cr (make-instance 'credit-rating)) + (slot-attribute cr 'level 'date-set)) + nil) + + (deftest attrib.mop.2 + (progn + (setq cr (make-instance 'credit-rating)) + (setf (slot-attribute cr 'level 'date-set) "12/15/1990") + (slot-attribute cr 'level 'date-set)) + "12/15/1990") + + (deftest attrib.mop.3 + (progn + (setq mcr (make-instance 'monitored-credit-rating)) + (setf (slot-attribute mcr 'level 'date-set) "01/05/2002") + (slot-attribute mcr 'level 'date-set)) + "01/05/2002") - (format t "~&date-set: ~a" (slot-attribute cr 'level 'date-set)) - (setf (slot-attribute cr 'level 'date-set) "12/15/1990") -(format t "~&date-set: ~a" (slot-attribute cr 'level 'date-set)) - -(defclass monitored-credit-rating (credit-rating) - ((level :attributes (last-checked interval date-set)) - (cc :initarg :cc) - (id :attributes (verified)) - ) - (:metaclass attributes-class)) -(defparameter mcr (make-instance 'monitored-credit-rating)) - -(setf (slot-attribute mcr 'level 'date-set) "01/05/2002") -(format t "~&date-set for mcr: ~a" (slot-attribute mcr 'level 'date-set)) -) ;; kmrcl-mop + ) ;; kmrcl-mop +#+kmrtest-mop +(setq cl:*features* (delete :kmrtest-mop cl:*features*))