diff options
Diffstat (limited to 'src/testdir/test_gettext_cp1251.vim')
-rw-r--r-- | src/testdir/test_gettext_cp1251.vim | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/testdir/test_gettext_cp1251.vim b/src/testdir/test_gettext_cp1251.vim index c91f7848af..69d2bbf4cd 100644 --- a/src/testdir/test_gettext_cp1251.vim +++ b/src/testdir/test_gettext_cp1251.vim @@ -2,22 +2,32 @@ source check.vim " 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 bindtextdomain("__PACKAGE__", getcwd()) - try - language messages ru_RU - call assert_equal('ÎØÈÁÊÀ: ', gettext("ERROR: ", "__PACKAGE__")) - catch /^Vim\%((\a\+)\)\=:E197:/ - throw "Skipped: not possible to set locale to ru (missing?)" - endtry + call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__")) + try - language messages en_GB.UTF-8 - call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__")) - catch /^Vim\%((\a\+)\)\=:E197:/ - throw "Skipped: not possible to set locale to en (missing?)" + call assert_true(bindtextdomain("__PACKAGE__", getcwd())) + + try + language messages ru_RU + call assert_equal('ÎØÈÁÊÀ: ', gettext("ERROR: ", "__PACKAGE__")) + catch /^Vim\%((\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 /^Vim\%((\a\+)\)\=:E197:/ + throw "Skipped: not possible to set locale to en (missing?)" + endtry + + catch /^Vim\%((\a\+)\)\=:E342:/ + throw "Skipped: out of memory executing bindtextdomain()" endtry set encoding& endfunc |