From 992b375d61a25c3ea96a77b1552a45736ca15c9f Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Wed, 1 Sep 2004 22:54:28 +0000 Subject: [PATCH] (~@d): New tests. --- test-suite/tests/format.test | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test index 90f24efaf..3ee5ef571 100644 --- a/test-suite/tests/format.test +++ b/test-suite/tests/format.test @@ -40,6 +40,36 @@ (pass-if "format ~F (format-out-substr) maintains the column correctly" (= (string-length (format "~@F~20T" 1)) 20))) +;;; +;;; ~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")))) + +;;; +;;; ~t +;;; + +(with-test-prefix "~t column advance" + + ;; in guile 1.6.4 and earlier, a newline as a fill character didn't zero + ;; the column number, making a subsequent ~t wrong + (pass-if "newline as fill character" + (string=? (format #f "~6,'\nd~8tX" 123) + "\n\n\n123 X"))) + ;;; ;;; ~{ ;;;