mirror of
https://github.com/vim/vim.git
synced 2026-05-26 20:17:35 +02:00
b0905e269d
Problem: tests: too many imports in the test suite Solution: Clean up the imported scripts Most tests make use of check.vim, so let's just source it once in runtest.vim instead of having each test manually source it. runtest.vim already sources shared.vim, which again sources view_util.vim, so we don't need to source those two common dependencies in all the other tests And then check.vim sources term_util.vim already, so we can in addition drop sourcing it explicitly in each single test script. Note: test_expand_func.vim had to be updated to account for the changed number of sourced files. And finally check.vim uses line-continuation so let's also explicitly enable line continuation via the 'cpo' option value. related: #17677 Signed-off-by: Christian Brabandt <cb@256bit.org>
35 lines
963 B
VimL
35 lines
963 B
VimL
" 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 /^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
|
|
|
|
" vim: shiftwidth=2 sts=2 expandtab
|