From: Olof-Joachim Frahm Date: Tue, 21 May 2013 19:07:37 +0000 (+0200) Subject: Accept both cases for FORMAT by using CHAR-UPCASE. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=f65fcfd1e3defb2f428cda3a54e02488463d1183;p=jscl.git Accept both cases for FORMAT by using CHAR-UPCASE. --- diff --git a/src/print.lisp b/src/print.lisp index f5360bc..42ceba4 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -281,6 +281,6 @@ res))) (defun format-special (chr arg) - (case chr + (case (char-upcase chr) (#\S (prin1-to-string arg)) - (#\a (princ-to-string arg)))) + (#\A (princ-to-string arg)))) diff --git a/tests/format.lisp b/tests/format.lisp index ad61954..a3eae9d 100644 --- a/tests/format.lisp +++ b/tests/format.lisp @@ -8,7 +8,9 @@ a" (format nil "a~%a"))) (test (string= "this is foo" (format nil "this is ~a" "foo"))) +(test (string= "this is foo" (format nil "this is ~A" "foo"))) +(test (string= "this is \"foo\"" (format nil "this is ~s" "foo"))) (test (string= "this is \"foo\"" (format nil "this is ~S" "foo"))) (test (string= "this is 2" (format nil "this is ~*~A" 1 2)))