1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 06:50:31 +02:00

i18n: Skips ~h `format' tests when digit grouping info is missing.

* test-suite/tests/i18n.test ("format ~h"): Skip tests when
  `locale-digit-grouping' returns '().
This commit is contained in:
Ludovic Courtès 2012-02-04 23:38:47 +01:00
parent bc02028b52
commit 13fb25ba0c

View file

@ -495,22 +495,30 @@
(with-test-prefix "format ~h" (with-test-prefix "format ~h"
;; Some systems like Darwin lack the `GROUPING' nl_item, and thus
;; `locale-digit-grouping' defaults to '(); skip the tests in that
;; case.
(with-test-prefix "French" (with-test-prefix "French"
(pass-if "12345.5678" (pass-if "12345.5678"
(under-french-locale-or-unresolved (under-french-locale-or-unresolved
(lambda () (lambda ()
(string=? "12 345,6789" (if (null? (locale-digit-grouping %french-locale))
(format #f "~:h" 12345.6789 %french-locale)))))) (throw 'unresolved)
(string=? "12 345,6789"
(format #f "~:h" 12345.6789 %french-locale)))))))
(with-test-prefix "English" (with-test-prefix "English"
(pass-if "12345.5678" (pass-if "12345.5678"
(under-american-english-locale-or-unresolved (under-american-english-locale-or-unresolved
(lambda () (lambda ()
(string=? "12,345.6789" (if (null? (locale-digit-grouping %american-english-locale))
(format #f "~:h" 12345.6789 (throw 'unresolved)
%american-english-locale))))))) (string=? "12,345.6789"
(format #f "~:h" 12345.6789
%american-english-locale))))))))
(with-test-prefix "monetary-amount->locale-string" (with-test-prefix "monetary-amount->locale-string"