X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcondition.pure.lisp;h=0b071d85cfcbb9ec40f256eaed3cd0305ebe9226;hb=6b8604ad86a30578a776d706d01b2f3ab3fac8f2;hp=835818e72d65304a586a9a3a8daeca5916d0954f;hpb=c4776b3b3121be1c3bad293a4fa7efffb592f7f7;p=sbcl.git diff --git a/tests/condition.pure.lisp b/tests/condition.pure.lisp index 835818e..0b071d8 100644 --- a/tests/condition.pure.lisp +++ b/tests/condition.pure.lisp @@ -163,3 +163,29 @@ (assert (equal '(restart-case (foo :report "quux" (quux))) (simple-condition-format-arguments e))) :ok))))) + +(with-test (:name :simple-condition-without-args) + (let ((sc (make-condition 'simple-condition))) + (assert (not (simple-condition-format-control sc))) + (assert (not (simple-condition-format-arguments sc))) + (assert (stringp (prin1-to-string sc))) + (assert + (eq :ok + (handler-case + (princ-to-string sc) + (simple-error (c) + (when (and (equal "No format-control for ~S" + (simple-condition-format-control c)) + (eq sc (car + (simple-condition-format-arguments c)))) + :ok))))))) + +(with-test (:name :malformed-simple-condition-printing-type-error) + (assert (eq :type-error + (handler-case + (princ-to-string + (make-condition 'simple-error :format-control "" :format-arguments 8)) + (type-error (e) + (when (and (eq 'list (type-error-expected-type e)) + (eql 8 (type-error-datum e))) + :type-error))))))