[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/01: Test format ~f with width parameters
From: |
Daniel Llorens |
Subject: |
[Guile-commits] 01/01: Test format ~f with width parameters |
Date: |
Thu, 15 Dec 2016 11:58:26 +0000 (UTC) |
lloda pushed a commit to branch master
in repository guile.
commit 546eb479b1fc7e3143b05aaeec16175d1cea0e08
Author: Daniel Llorens <address@hidden>
Date: Thu Dec 15 12:47:08 2016 +0100
Test format ~f with width parameters
* test-suite/tests/format.test: Additional tests for ~f.
---
test-suite/tests/format.test | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test
index cc31942..e7b7afd 100644
--- a/test-suite/tests/format.test
+++ b/test-suite/tests/format.test
@@ -108,6 +108,15 @@
(pass-if "3/2"
(string=? "1.5" (format #f "~f" 3/2)))
+
+ (pass-if "~2f"
+ (string=? "10." (format #f "~2f" 9.9)))
+
+ (pass-if "~2,1f"
+ (string=? "9.9" (format #f "~2,1f" 9.9)))
+
+ (pass-if "~2,2f"
+ (string=? "9.90" (format #f "~2,2f" 9.9)))
;; in guile prior to 1.6.9 and 1.8.1, leading zeros were incorrectly
;; stripped, moving the decimal point and giving "25.0" here