diff options
Diffstat (limited to 'Sacla/tests/should-character.lisp')
-rw-r--r-- | Sacla/tests/should-character.lisp | 252 |
1 files changed, 252 insertions, 0 deletions
diff --git a/Sacla/tests/should-character.lisp b/Sacla/tests/should-character.lisp new file mode 100644 index 0000000..40643ad --- /dev/null +++ b/Sacla/tests/should-character.lisp @@ -0,0 +1,252 @@ +;; Copyright (C) 2002-2004, Yuji Minejima <ggb01164@nifty.ne.jp> +;; ALL RIGHTS RESERVED. +;; +;; $Id: should-character.lisp,v 1.10 2004/02/20 07:23:42 yuji Exp $ +;; +;; Redistribution and use in source and binary forms, with or without +;; modification, are permitted provided that the following conditions +;; are met: +;; +;; * Redistributions of source code must retain the above copyright +;; notice, this list of conditions and the following disclaimer. +;; * Redistributions in binary form must reproduce the above copyright +;; notice, this list of conditions and the following disclaimer in +;; the documentation and/or other materials provided with the +;; distribution. +;; +;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(HANDLER-CASE (PROGN (CHAR=)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR/=)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR<)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR>)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR<=)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR>=)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHAR-EQUAL)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-NOT-EQUAL)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-LESSP)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-GREATERP)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-NOT-GREATERP)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-NOT-LESSP)) + (PROGRAM-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + + +(HANDLER-CASE (PROGN (CHARACTER "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHARACTER 'MORE-THAN-ONE)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHARACTER '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (ALPHA-CHAR-P "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (ALPHA-CHAR-P 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (ALPHA-CHAR-P '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (ALPHANUMERICP "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (ALPHANUMERICP 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (ALPHANUMERICP '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(progn + #-cmu + (HANDLER-CASE (PROGN (GRAPHIC-CHAR-P "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + #+cmu 'skipped) + +(progn + #-cmu + (HANDLER-CASE (PROGN (GRAPHIC-CHAR-P 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + #+cmu 'skipped) + +(progn + #-cmu + (HANDLER-CASE (PROGN (GRAPHIC-CHAR-P '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + #+cmu 'skipped) + +(HANDLER-CASE (PROGN (STANDARD-CHAR-P "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (STANDARD-CHAR-P 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (STANDARD-CHAR-P '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHAR-UPCASE "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-UPCASE 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-UPCASE '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHAR-DOWNCASE "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-DOWNCASE 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-DOWNCASE '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (UPPER-CASE-P "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (UPPER-CASE-P 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (UPPER-CASE-P '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (LOWER-CASE-P "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (LOWER-CASE-P 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (LOWER-CASE-P '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (BOTH-CASE-P "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (BOTH-CASE-P 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (BOTH-CASE-P '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHAR-CODE "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-CODE 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-CODE '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (CHAR-NAME "abc")) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-NAME 'NOT-A-CHAR)) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) +(HANDLER-CASE (PROGN (CHAR-NAME '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) + +(HANDLER-CASE (PROGN (NAME-CHAR '(NIL))) + (TYPE-ERROR NIL T) + (ERROR NIL NIL) + (:NO-ERROR (&REST REST) (DECLARE (IGNORE REST)) NIL)) |