From 726804874f1d502d04c258d8203b1d8edfc832a0 Mon Sep 17 00:00:00 2001 From: Mike Gran Date: Mon, 20 Mar 2017 07:38:12 -0700 Subject: [PATCH] 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 4be2ec518..478a0c3c7 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.