[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 03/03: i18n: add tests for locale-digit-grouping
From: |
Mike Gran |
Subject: |
[Guile-commits] 03/03: i18n: add tests for locale-digit-grouping |
Date: |
Mon, 20 Mar 2017 10:40:18 -0400 (EDT) |
mike121 pushed a commit to branch master
in repository guile.
commit 726804874f1d502d04c258d8203b1d8edfc832a0
Author: Mike Gran <address@hidden>
Date: Mon Mar 20 07:38:12 2017 -0700
i18n: add tests for locale-digit-grouping
* test-suite/tests/i18n.test ("nl-langinfo et al."): new tests
---
test-suite/tests/i18n.test | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/test-suite/tests/i18n.test b/test-suite/tests/i18n.test
index 4be2ec5..478a0c3 100644
--- a/test-suite/tests/i18n.test
+++ b/test-suite/tests/i18n.test
@@ -504,6 +504,26 @@
(not (not (member (locale-pm-string %greek-utf8-locale)
'("ΜΜ" "μμ" "Μ.Μ." "μ.μ.")))))))
+ (pass-if "locale-digit-grouping"
+ ;; In the C locale, there is no rule for grouping.
+ (null? (locale-digit-grouping)))
+
+ (pass-if "locale-digit-grouping (French)"
+ (under-french-locale-or-unresolved
+ (lambda ()
+ ;; All systems that have a GROUPING nl_item should know
+ ;; that French numbers are grouped in 3 digit chunks.
+ ;; Those systems that have no GROUPING nl_item may use
+ ;; the hard-coded default of no grouping.
+ (let ((result (locale-digit-grouping %french-locale)))
+ (cond
+ ((null? result)
+ (throw 'unresolved))
+ ((eqv? 3 (false-if-exception (car result)))
+ #t)
+ (else
+ #f))))))
+
(pass-if "locale-monetary-grouping"
;; In the C locale, there is no rule for grouping of digits
;; of monetary values.