X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Finterface.impure.lisp;h=31cb5171528a5ac599b66cd6dcd2824a031e4da0;hb=746c4003dd76ea67647c87176e4c818f512d59b7;hp=2de57660b6d96da3ccdbf9bc555d9d83aa351a1c;hpb=4c81c652cdc32faefee1bccb84c3c9a7854e3edd;p=sbcl.git diff --git a/tests/interface.impure.lisp b/tests/interface.impure.lisp index 2de5766..31cb517 100644 --- a/tests/interface.impure.lisp +++ b/tests/interface.impure.lisp @@ -83,15 +83,20 @@ ;;; support for DESCRIBE tests (defstruct to-be-described a b) (defclass forward-describe-class (forward-describe-ref) (a)) +(let ((sb-ext:*evaluator-mode* :compile)) + (eval `(let (x) (defun closure-to-describe () (incf x))))) ;;; DESCRIBE should run without signalling an error. -(describe (make-to-be-described)) -(describe 12) -(describe "a string") -(describe 'symbolism) -(describe (find-package :cl)) -(describe '(a list)) -(describe #(a vector)) +(with-test (:name (describe :no-error)) + (describe (make-to-be-described)) + (describe 12) + (describe "a string") + (describe 'symbolism) + (describe (find-package :cl)) + (describe '(a list)) + (describe #(a vector)) +;; bug 824974 + (describe 'closure-to-describe)) ;;; The DESCRIBE-OBJECT methods for built-in CL stuff should do ;;; FRESH-LINE and TERPRI neatly. @@ -259,5 +264,38 @@ (assert (equal "foo" (documentation 'bug-643958-test 'function))) (setf (documentation 'bug-643958-test 'function) "bar") (assert (equal "bar" (documentation 'bug-643958-test 'function)))) + +(defclass cannot-print-this () + ()) +(defmethod print-object ((oops cannot-print-this) stream) + (error "No go!")) +(with-test (:name :describe-suppresses-print-errors) + (handler-bind ((error #'continue)) + (with-output-to-string (s) + (describe (make-instance 'cannot-print-this) s)))) +(with-test (:name :backtrace-suppresses-print-errors) + (handler-bind ((error #'continue)) + (with-output-to-string (s) + (labels ((foo (n x) + (when (plusp n) + (foo (1- n) x)) + (when (zerop n) + (sb-debug:backtrace 100 s)))) + (foo 100 (make-instance 'cannot-print-this)))))) +(with-test (:name :backtrace-and-circles) + (handler-bind ((error #'continue)) + (with-output-to-string (s) + (labels ((foo (n x) + (when (plusp n) + (foo (1- n) x)) + (when (zerop n) + (sb-debug:backtrace 100 s)))) + (foo 100 (let ((list (list t))) + (nconc list list))))))) + +(with-test (:name :endianness-in-features) + (assert + (or (member :big-endian *features*) + (member :little-endian *features*)))) ;;;; success