Mercurial > vim
view src/testdir/test_command_count.vim @ 33333:fed9c5ffde42
patch 9.0.1931: make test_compilers fails on ubuntu
Commit: https://github.com/vim/vim/commit/ca0ffc0d63727850c520a80929698e4c199b17f4
Author: Dominique Pell? <dominique.pelle@tomtom.com>
Date: Sun Sep 24 22:57:41 2023 +0200
patch 9.0.1931: make test_compilers fails on ubuntu
Problem: make test_compilers fails on ubuntu
Solution: set LC_ALL=C
fix: make test_compiler failed on xubuntu 22.04.3
Problem: 'make test_compiler' failed on Linux xubuntu 22.04.3 but
succeeded on e.g. macOS. To reproduce:
```
$ ./configure --with-features=huge --enable-gui=no --enable-perlinterp=yes
$ make -j12
$ cd vim/src/testdir
$ make test_compiler
...snip...
Found errors in Test_compiler():
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 24: command did not fail: clist
command line..script /home/dope/sb/vim/src/testdir/runtest.vim[601]..function RunTheTest[54]..Test_compiler line 30: Pattern '\\n \\d\\+ Xfoo.pl:3: Global symbol "$foo" requires explicit package name' does not match '\n19 Xfoo.pl:3: Global symbol "$foo" requires explicit package name (did you forget to declare "my $foo"?)'
make: *** [Makefile:70: test_compiler] Error 1
```
Solution: set `LC_ALL` to "C" in `Test_compiler()`
closes: #13173
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pell? <dominique.pelle@tomtom.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Sep 2023 23:00:04 +0200 |
parents | 08940efa6b4e |
children |
line wrap: on
line source
" Test for user command counts. func Test_command_count_0() let bufnr = bufnr('%') set hidden set noswapfile split DoesNotExistEver let lastbuf = bufnr('$') call setline(1, 'asdf') quit! command! -range -addr=loaded_buffers RangeLoadedBuffers :let lines = [<line1>, <line2>] command! -range=% -addr=loaded_buffers RangeLoadedBuffersAll :let lines = [<line1>, <line2>] command! -range -addr=buffers RangeBuffers :let lines = [<line1>, <line2>] command! -range=% -addr=buffers RangeBuffersAll :let lines = [<line1>, <line2>] .,$RangeLoadedBuffers call assert_equal([bufnr, bufnr], lines) %RangeLoadedBuffers call assert_equal([bufnr, bufnr], lines) RangeLoadedBuffersAll call assert_equal([bufnr, bufnr], lines) .,$RangeBuffers call assert_equal([bufnr, lastbuf], lines) %RangeBuffers call assert_equal([bufnr, lastbuf], lines) RangeBuffersAll call assert_equal([bufnr, lastbuf], lines) delcommand RangeLoadedBuffers delcommand RangeLoadedBuffersAll delcommand RangeBuffers delcommand RangeBuffersAll set hidden& set swapfile& endfunc func Test_command_count_1() silent! %argd arga a b c d e argdo echo "loading buffers" argu 3 command! -range -addr=arguments RangeArguments :let lines = [<line1>, <line2>] command! -range=% -addr=arguments RangeArgumentsAll :let lines = [<line1>, <line2>] .-,$-RangeArguments call assert_equal([2, 4], lines) %RangeArguments call assert_equal([1, 5], lines) RangeArgumentsAll call assert_equal([1, 5], lines) N .RangeArguments call assert_equal([2, 2], lines) delcommand RangeArguments delcommand RangeArgumentsAll split|split|split|split 3wincmd w command! -range -addr=windows RangeWindows :let lines = [<line1>, <line2>] .,$RangeWindows call assert_equal([3, 5], lines) %RangeWindows call assert_equal([1, 5], lines) delcommand RangeWindows command! -range=% -addr=windows RangeWindowsAll :let lines = [<line1>, <line2>] RangeWindowsAll call assert_equal([1, 5], lines) delcommand RangeWindowsAll only blast|bd tabe|tabe|tabe|tabe normal 2gt command! -range -addr=tabs RangeTabs :let lines = [<line1>, <line2>] .,$RangeTabs call assert_equal([2, 5], lines) %RangeTabs call assert_equal([1, 5], lines) delcommand RangeTabs command! -range=% -addr=tabs RangeTabsAll :let lines = [<line1>, <line2>] RangeTabsAll call assert_equal([1, 5], lines) delcommand RangeTabsAll 1tabonly s/\n/\r\r\r\r\r/ 2ma< $-ma> command! -range=% RangeLines :let lines = [<line1>, <line2>] '<,'>RangeLines call assert_equal([2, 5], lines) delcommand RangeLines command! -range=% -buffer LocalRangeLines :let lines = [<line1>, <line2>] '<,'>LocalRangeLines call assert_equal([2, 5], lines) delcommand LocalRangeLines endfunc func Test_command_count_2() silent! %argd arga a b c d call assert_fails('5argu', 'E16:') $argu call assert_equal('d', expand('%:t')) 1argu call assert_equal('a', expand('%:t')) call assert_fails('300b', 'E16:') split|split|split|split 0close $wincmd w $close call assert_equal(3, winnr()) call assert_fails('$+close', 'E16:') $tabe call assert_equal(2, tabpagenr()) call assert_fails('$+tabe', 'E16:') only! e x 0tabm normal 1gt call assert_equal('x', expand('%:t')) tabonly! only! endfunc func Test_command_count_3() let bufnr = bufnr('%') se nohidden e aaa let buf_aaa = bufnr('%') e bbb let buf_bbb = bufnr('%') e ccc let buf_ccc = bufnr('%') exe bufnr . 'buf' call assert_equal([1, 1, 1], [buflisted(buf_aaa), buflisted(buf_bbb), buflisted(buf_ccc)]) exe buf_bbb . "," . buf_ccc . "bdelete" call assert_equal([1, 0, 0], [buflisted(buf_aaa), buflisted(buf_bbb), buflisted(buf_ccc)]) exe buf_aaa . "bdelete" call assert_equal([0, 0, 0], [buflisted(buf_aaa), buflisted(buf_bbb), buflisted(buf_ccc)]) endfunc func Test_command_count_4() %argd let bufnr = bufnr('$') next aa bb cc dd ee ff call assert_equal(bufnr, bufnr('%')) 3argu let args = [] .,$-argdo call add(args, expand('%')) call assert_equal(['cc', 'dd', 'ee'], args) " create windows to get 5 split|split|split|split 2wincmd w let windows = [] .,$-windo call add(windows, winnr()) call assert_equal([2, 3, 4], windows) only! exe bufnr . 'buf' let bufnr = bufnr('%') let buffers = [] .,$-bufdo call add(buffers, bufnr('%')) call assert_equal([bufnr, bufnr + 1, bufnr + 2, bufnr + 3, bufnr + 4], buffers) exe (bufnr + 3) . 'bdel' let buffers = [] exe (bufnr + 2) . ',' . (bufnr + 5) . "bufdo call add(buffers, bufnr('%'))" call assert_equal([bufnr + 2, bufnr + 4, bufnr + 5], buffers) " create tabpages to get 5 tabe|tabe|tabe|tabe normal! 2gt let tabpages = [] .,$-tabdo call add(tabpages, tabpagenr()) call assert_equal([2, 3, 4], tabpages) tabonly! bwipe! endfunc " vim: shiftwidth=2 sts=2 expandtab