summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-02-03 14:31:17 +0100
committerLudovic Courtès <ludo@gnu.org>2012-02-03 14:31:17 +0100
commitc76fdf69a833378ce18228d242e926009df9add1 (patch)
tree4c8e6db69d18811758efd4d517c34d082f4efadc
parenta0919aefee7512686c3374876df2c549fd47e071 (diff)
downloadguile-c76fdf69a833378ce18228d242e926009df9add1.tar.gz
i18n: Add a couple of tests for `monetary-amount->locale-string'.
* test-suite/tests/i18n.test ("monetary-amount->locale-string"): New test prefix.
-rw-r--r--test-suite/tests/i18n.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/test-suite/tests/i18n.test b/test-suite/tests/i18n.test
index d1b0a542b..f7824d39b 100644
--- a/test-suite/tests/i18n.test
+++ b/test-suite/tests/i18n.test
@@ -479,3 +479,21 @@
(let ((fr (make-locale LC_ALL %french-locale-name)))
(string=? "1 234,5"
(number->locale-string 1234.567 1 fr))))))))
+
+(with-test-prefix "monetary-amount->locale-string"
+
+ (with-test-prefix "French"
+
+ (pass-if "integer"
+ (under-french-locale-or-unresolved
+ (lambda ()
+ (let ((fr (make-locale LC_ALL %french-locale-name)))
+ (string=? "123 456 +EUR"
+ (monetary-amount->locale-string 123456 #f fr))))))
+
+ (pass-if "fraction"
+ (under-french-locale-or-unresolved
+ (lambda ()
+ (let ((fr (make-locale LC_ALL %french-locale-name)))
+ (string=? "1 234,56 EUR "
+ (monetary-amount->locale-string 1234.567 #t fr))))))))