diff options
Diffstat (limited to 'mnv/src/testdir/test_gettext_cp1251.mnv')
| -rw-r--r-- | mnv/src/testdir/test_gettext_cp1251.mnv | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mnv/src/testdir/test_gettext_cp1251.mnv b/mnv/src/testdir/test_gettext_cp1251.mnv new file mode 100644 index 0000000000..10cdaad85f --- /dev/null +++ b/mnv/src/testdir/test_gettext_cp1251.mnv @@ -0,0 +1,34 @@ +" This fail on CI MacOS 14 because bindtextdomain() is not available there +" (missing library?) +CheckNotMac +CheckFeature gettext + +" Test for gettext() +func Test_gettext() + set encoding=cp1251 + call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__")) + + try + call assert_true(bindtextdomain("__PACKAGE__", getcwd())) + + try + language messages ru_RU + call assert_equal('������: for __PACKAGE__', gettext("ERROR: ", "__PACKAGE__")) + catch /^MNV\%((\a\+)\)\=:E197:/ + throw "Skipped: not possible to set locale to ru (missing?)" + endtry + + try + language messages en_GB.UTF-8 + call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__")) + catch /^MNV\%((\a\+)\)\=:E197:/ + throw "Skipped: not possible to set locale to en (missing?)" + endtry + + catch /^MNV\%((\a\+)\)\=:E342:/ + throw "Skipped: out of memory executing bindtextdomain()" + endtry + set encoding& +endfunc + +" mnv: shiftwidth=2 sts=2 expandtab |
