diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/calp/translation.scm | 17 | ||||
-rw-r--r-- | tests/unit/coverage-supplement.scm | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/unit/calp/translation.scm b/tests/unit/calp/translation.scm new file mode 100644 index 00000000..9ef55830 --- /dev/null +++ b/tests/unit/calp/translation.scm @@ -0,0 +1,17 @@ +(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)) + +'((calp translation)) diff --git a/tests/unit/coverage-supplement.scm b/tests/unit/coverage-supplement.scm index 288eeda2..b8cea855 100644 --- a/tests/unit/coverage-supplement.scm +++ b/tests/unit/coverage-supplement.scm @@ -107,6 +107,13 @@ 2) + ("module/calp/translation.scm" + "b7c0a82e1c109c339cf83438f39b6fc63219b51a3ad3ee35d58e70fb6a24c5c9" + 1 + 9 ; bindtextdomain + 22 ; G_ function + ) + ;;; Vendored files, and therefore shouldn't be tested ("module/srfi/srfi-64/test-error.scm" |