commit 5e1a3df5ae0c424185930e36c6328da47c8d99e3
parent a60d5f863e060ff35a38e0d5a829dfe5b8aaecac
Author: Kevin Goodsell <58675+KevinGoodsell@users.noreply.github.com>
Date: Fri, 30 Jan 2026 02:58:37 -0800
vim-patch:9.1.2119: tests: Test_language_cmd fails on OpenBSD (#37503)
Problem: tests: Test_language_cmd fails on OpenBSD because the test
uses an invalid locale name and expects the command to produce
an error. OpenBSD accepts (almost) any locale name as valid by
design, so the :lang command succeeds and the test fails.
Solution: Slightly update the "bad" locale name to make it something
that OpenBSD considers invalid by adding a dot (but not ending
with ".UTF-8"). Maintain the original two underscores in the
name because that ensures Windows will also see it as invalid
(Kevin Goodsell).
closes: vim/vim#19280
https://github.com/vim/vim/commit/371583642a5eecc134d285e6df49f5edceeab95c
Diffstat:
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/test/old/testdir/test_excmd.vim b/test/old/testdir/test_excmd.vim
@@ -248,8 +248,15 @@ endfunc
func Test_language_cmd()
CheckFeature multi_lang
- call assert_fails('language ctype non_existing_lang', 'E197:')
- call assert_fails('language time non_existing_lang', 'E197:')
+ " OpenBSD allows nearly arbitrary locale names, since it largely ignores them
+ " (see setlocale(3)). One useful exception for this test is that in doesn't
+ " allow names containing dots unless they end in '.UTF-8'.
+ "
+ " Windows also allows nonsensical locale names, though it seems to reject
+ " names with multiple underscores (possibly expecting 'language_region', but
+ " not 'language_region_additional').
+ call assert_fails('language ctype non_existing_lang.bad', 'E197:')
+ call assert_fails('language time non_existing_lang.bad', 'E197:')
endfunc
" Test for the :confirm command dialog