X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fprint.impure.lisp;h=e17492d5abe407d839351f26932632410723dccd;hb=a27839c3a9c59b2ca1b4080de5a3a9dd682ac5b9;hp=37e59369a6d31e70d642fb2be3ce1a0bd094e391;hpb=a7f04616aa9d77ba780a2a6cf6c78b250b1d4a07;p=sbcl.git diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index 37e5936..e17492d 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -402,12 +402,10 @@ (ignore-errors (delete-file file))))) -#+sb-unicode -(with-test (:name (:print-readable :character :utf-8)) +(with-test (:name (:print-readable :character :utf-8) :skipped-on '(not :sb-unicode)) (test-readable-character (code-char #xfffe) :utf-8)) -#+sb-unicode -(with-test (:name (:print-readable :character :iso-8859-1)) +(with-test (:name (:print-readable :character :iso-8859-1) :skipped-on '(not :sb-unicode)) (test-readable-character (code-char #xfffe) :iso-8859-1)) (assert (string= (eval '(format nil "~:C" #\a)) "a")) @@ -483,4 +481,30 @@ (assert (= 123 (funcall (compile nil (lambda () (write 123))))))) +(with-test (:name :write/write-to-string-compiler-macro-lp/598374+581564) + (let ((test (compile nil + `(lambda (object &optional output-stream) + (write object + :stream output-stream))))) + (assert (equal "(HELLO WORLD)" + (with-output-to-string (*standard-output*) + (let ((list '(hello world))) + (assert (eq list (funcall test list))))))) + (assert (equal "12" + (with-output-to-string (*standard-output*) + (assert (eql 12 (funcall test 12))))))) + (let ((test (compile nil + `(lambda () + (let ((*print-length* 42)) + (write-to-string *print-length* :length nil)))))) + (assert (equal "42" (funcall test))))) + +(with-test (:name (:format :compile-literal-dest-string)) + (assert (eq :warned + (handler-case + (compile nil + `(lambda (x) (format "~A" x))) + ((and warning (not style-warning)) () + :warned))))) + ;;; success