diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test index 82252b55b..e55fce7ac 100644 --- a/test-suite/tests/format.test +++ b/test-suite/tests/format.test @@ -38,6 +38,24 @@ (format #t "~&~&"))) "xyz\nabc\n"))) +;;; +;;; ~d +;;; + +(with-test-prefix "~d decimal integer" + + (with-test-prefix "~@d" + + (pass-if "-1" + (string=? (format #f "~@d" -1) "-1")) + ;; in guile 1.6.4 and earlier, ~@d gave "0" but we think "+0" is what the + ;; common lisp spec intendes + (pass-if "+0" + (string=? (format #f "~@d" 0) "+0")) + + (pass-if "+1" + (string=? (format #f "~@d" 1) "+1")))) + ;;; ;;; ~{ ;;;