Christ van Willegen | ce0ef91 | 2024-06-20 23:41:59 +0200 | [diff] [blame] | 1 | source check.vim |
| 2 | |
Christ van Willegen | 8252ef1 | 2024-07-11 21:36:21 +0200 | [diff] [blame] | 3 | CheckFeature gettext |
| 4 | |
Christ van Willegen | ce0ef91 | 2024-06-20 23:41:59 +0200 | [diff] [blame] | 5 | " Test for gettext() |
| 6 | func 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 Willegen | c078675 | 2025-02-01 15:42:16 +0100 | [diff] [blame] | 16 | |
| 17 | call assert_equal('ERROR: ', ngettext("ERROR: ", "ERROR: ", 1, "__PACKAGE__")) |
| 18 | call assert_equal('ERRORS: ', ngettext("ERROR: ", "ERRORS: ", 2, "__PACKAGE__")) |
Christ van Willegen | ce0ef91 | 2024-06-20 23:41:59 +0200 | [diff] [blame] | 19 | endfunc |
| 20 | |
| 21 | " vim: shiftwidth=2 sts=2 expandtab |