blob: ddfc402a3da322fb6784acfaa1300b9b37fe6285 [file] [log] [blame]
Christ van Willegence0ef912024-06-20 23:41:59 +02001source check.vim
2
Christ van Willegen8252ef12024-07-11 21:36:21 +02003CheckFeature gettext
4
Christ van Willegence0ef912024-06-20 23:41:59 +02005" Test for gettext()
6func Test_gettext()
7 call assert_fails('call bindtextdomain("test")', 'E119:')
8 call assert_fails('call bindtextdomain("vim", "test")', 'E475:')
9
10 call assert_fails('call gettext(1)', 'E1174:')
11 call assert_equal('xxxTESTxxx', gettext("xxxTESTxxx"))
12
13 call assert_equal('xxxTESTxxx', gettext("xxxTESTxxx", "vim"))
14 call assert_equal('xxxTESTxxx', gettext("xxxTESTxxx", "__PACKAGE__"))
15 call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__"))
Christ van Willegenc0786752025-02-01 15:42:16 +010016
17 call assert_equal('ERROR: ', ngettext("ERROR: ", "ERROR: ", 1, "__PACKAGE__"))
18 call assert_equal('ERRORS: ', ngettext("ERROR: ", "ERRORS: ", 2, "__PACKAGE__"))
Christ van Willegence0ef912024-06-20 23:41:59 +020019endfunc
20
21" vim: shiftwidth=2 sts=2 expandtab