From 7da09e28b2b3354701a5d7d6dde06a2a03c6b11d Mon Sep 17 00:00:00 2001 From: Jan Moringen Date: Thu, 20 Oct 2016 09:52:45 +0200 Subject: [PATCH] Fix spaces in TYPE-ERROR report format control string The previous commit fixed non-pretty printing, but turned the pretty printed output into The value 1 is not of type STRING i.e. added the space at the beginning of the third line. --- src/code/condition.lisp | 4 ++-- tests/condition.pure.lisp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/code/condition.lisp b/src/code/condition.lisp index 1117a642f..dc2a85eab 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -518,8 +518,8 @@ (:report (lambda (condition stream) (format stream "~@" (type-error-datum condition) (type-error-expected-type condition))))) diff --git a/tests/condition.pure.lisp b/tests/condition.pure.lisp index d517a0d0a..239e87dc9 100644 --- a/tests/condition.pure.lisp +++ b/tests/condition.pure.lisp @@ -384,3 +384,15 @@ (progn (push 2 result) nil) (push 3 result)) (assert (equal result '(3 2 1))))) + +(with-test (:name (type-error print *print-pretty*)) + (let ((error (make-condition 'type-error :datum 1 :expected-type 'string))) + (assert (string= (let ((*print-pretty* nil)) + (princ-to-string error)) + "The value 1 is not of type STRING")) + (assert (string= (let ((*print-pretty* t)) + (princ-to-string error)) + "The value + 1 +is not of type + STRING")))) -- 2.11.4.GIT