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