Skip to content
This repository has been archived by the owner on Feb 11, 2018. It is now read-only.

Commit

Permalink
Accept both cases for FORMAT by using CHAR-UPCASE.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferada committed Jun 7, 2013
1 parent e47b48d commit f65fcfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/print.lisp
Expand Up @@ -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))))
2 changes: 2 additions & 0 deletions tests/format.lisp
Expand Up @@ -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)))

0 comments on commit f65fcfd

Please sign in to comment.