Skip to content

Commit 6fdff01

Browse files
committed
Remove Test_macvim_default_locale_utf8() as upstream has a better test
The change got ported over and Test_mac_locale() in test_environ.vim now does the same thing except it doesn't rely on terminals and therefore is less flaky.
1 parent e877059 commit 6fdff01

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/testdir/test_macvim.vim

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
" Test for MacVim behaviors and regressions
22

33
source check.vim
4-
source term_util.vim
54
CheckFeature gui_macvim
65

76
" Tests for basic existence of commands and options to make sure no
@@ -55,43 +54,3 @@ func Test_macvim_mappings()
5554
call feedkeys("\<ForceClick>", "xt")
5655
call assert_equal(5, g:marker_value)
5756
endfunc
58-
59-
" Test that we correctly set the locale to have .UTF-8 if launching from the
60-
" Dock or the $LANG env variable is not set.
61-
func Test_macvim_default_locale_utf8()
62-
CheckRunVimInTerminal
63-
if !has('terminal') || !executable('/bin/sh')
64-
return
65-
endif
66-
let buf = term_start('/bin/sh')
67-
68-
" Wait for shell prompt.
69-
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
70-
71-
" Unset the $LANG environmental variable. This causes Vim to try to set a
72-
" default one in macOS.
73-
call term_sendkeys(buf, "unset LANG\<CR>")
74-
75-
" Run Vim and ask it to output the $LANG variable. It should be
76-
" automatically created since it doesn't exist.
77-
call term_sendkeys(buf, v:progpath
78-
\ . " --clean -X"
79-
\ . " -c 'echo $LANG'\<CR>")
80-
81-
" Wait for Vim to come up and show something in the status line.
82-
let term_rows = term_getsize(buf)[0]
83-
call term_wait(buf)
84-
call WaitFor({-> len(term_getline(buf, term_rows)) > 0})
85-
86-
" Check that the locale actually has .UTF-8 in it. We can't check for
87-
" "en_US.UTF-8" because we shouldn't assume what locale the tester is
88-
" using.
89-
call assert_match('^[a-zA-Z-_]\+\.UTF-8\>', term_getline(buf, term_rows), "Default locale doesn't have UTF-8 encoding set")
90-
91-
" Cleanly exist from Vim/terminal and clean up.
92-
call term_sendkeys(buf, ":qall!\<CR>")
93-
call term_wait(buf)
94-
call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))})
95-
call StopShellInTerminal(buf)
96-
exe buf . 'bwipe!'
97-
endfunc

0 commit comments

Comments
 (0)