diff options
Diffstat (limited to 'tests/test/translation.scm')
-rw-r--r-- | tests/test/translation.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test/translation.scm b/tests/test/translation.scm new file mode 100644 index 00000000..5fb32ab0 --- /dev/null +++ b/tests/test/translation.scm @@ -0,0 +1,15 @@ +(define-module (test translation) + :use-module (srfi srfi-64) + :use-module (srfi srfi-88) + :use-module (calp translation) + :use-module (ice-9 i18n)) + +(define sv (make-locale (list LC_CTYPE LC_MESSAGES) "sv_SE.UTF-8")) + +;; empty key should give us translation header +;; this also tests that translations are properly loaded +(test-assert "translations" (string? (translate ""))) + +(test-equal "yes-no yes" 'yes (yes-no-check "y" sv)) +(test-equal "yes-no no" 'no (yes-no-check "n" sv)) +(test-equal "yes-no invalid" #f (yes-no-check "other" sv)) |