Christian Brabandt | b0905e2 | 2025-07-07 20:39:29 +0200 | [diff] [blame] | 1 | " Test for gettext() |
Christ van Willegen | ce0ef91 | 2024-06-20 23:41:59 +0200 | [diff] [blame] | 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 | func 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 Willegen | c078675 | 2025-02-01 15:42:16 +0100 | [diff] [blame] | 15 | |
| 16 | call assert_equal('ERROR: ', ngettext("ERROR: ", "ERROR: ", 1, "__PACKAGE__")) |
| 17 | call assert_equal('ERRORS: ', ngettext("ERROR: ", "ERRORS: ", 2, "__PACKAGE__")) |
Christ van Willegen | ce0ef91 | 2024-06-20 23:41:59 +0200 | [diff] [blame] | 18 | endfunc |
| 19 | |
| 20 | " vim: shiftwidth=2 sts=2 expandtab |