view src/testdir/test_gettext.vim @ 35636:028f4c0dc018 v9.1.0560

patch 9.1.0560: bindtextdomain() does not indicate an error Commit: https://github.com/vim/vim/commit/8252ef134f5a57e8a07b66ce79068c262a6386d8 Author: Christ van Willegen <cvwillegen@gmail.com> Date: Thu Jul 11 21:36:21 2024 +0200 patch 9.1.0560: bindtextdomain() does not indicate an error Problem: bindtextdomain() does not indicate an error (after v9.1.509) Solution: return false on failure (OOM). (Chris van Willegen) closes: #15116 Signed-off-by: Christ van Willegen <cvwillegen@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 11 Jul 2024 21:45:03 +0200
parents 04563887d70e
children
line wrap: on
line source

source check.vim

CheckFeature gettext

" Test for gettext()
func Test_gettext()
  call assert_fails('call bindtextdomain("test")', 'E119:')
  call assert_fails('call bindtextdomain("vim", "test")', 'E475:')

  call assert_fails('call gettext(1)', 'E1174:')
  call assert_equal('xxxTESTxxx', gettext("xxxTESTxxx"))

  call assert_equal('xxxTESTxxx', gettext("xxxTESTxxx", "vim"))
  call assert_equal('xxxTESTxxx', gettext("xxxTESTxxx", "__PACKAGE__"))
  call assert_equal('ERROR: ', gettext("ERROR: ", "__PACKAGE__"))
endfunc

" vim: shiftwidth=2 sts=2 expandtab