Merge pull request #13521 from janlazo/nvim-8.1.2246

vim-patch:8.1.2246
This commit is contained in:
Jan Edmund Lazo 2020-12-12 09:07:23 -05:00 committed by GitHub
commit 4f9e7a512d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2208 additions and 2349 deletions

View File

@ -414,7 +414,7 @@ for s:test in sort(s:tests)
" Repeat a flaky test. Give up when:
" - it fails again with the same message
" - it fails five times (with a different mesage)
" - it fails five times (with a different message)
if len(v:errors) > 0
\ && (index(s:flaky_tests, s:test) >= 0
\ || v:errors[0] =~ s:flaky_errors_re)

View File

@ -1,6 +1,4 @@
Results of test49.vim:
*** Test 16: OK (8722)
*** Test 17: OK (285127993)
*** Test 18: OK (67224583)
*** Test 19: OK (69275973)
*** Test 20: OK (1874575085)
@ -8,16 +6,11 @@ Results of test49.vim:
*** Test 22: OK (4161)
*** Test 23: OK (49)
*** Test 24: OK (41)
*** Test 25: OK (260177811)
*** Test 26: OK (1681500476)
*** Test 27: OK (1996459)
*** Test 28: OK (1996459)
*** Test 29: OK (170428555)
*** Test 30: OK (190905173)
*** Test 31: OK (190905173)
*** Test 32: OK (354833067)
--- Test 33: sum = 178275600 (ok)
*** Test 33: OK (1216907538)
*** Test 34: OK (2146584868)
*** Test 35: OK (2146584868)
*** Test 36: OK (1071644672)
@ -25,17 +18,8 @@ Results of test49.vim:
*** Test 38: OK (357908480)
*** Test 39: OK (357908480)
*** Test 40: OK (357908480)
*** Test 41: OK (3076095)
*** Test 42: OK (1505155949)
*** Test 43: OK (1157763329)
*** Test 44: OK (1031761407)
*** Test 45: OK (1157763329)
*** Test 46: OK (739407)
*** Test 47: OK (371213935)
*** Test 48: OK (756255461)
*** Test 49: OK (179000669)
*** Test 50: OK (363550045)
*** Test 51: OK (40744667)
*** Test 52: OK (1247112011)
*** Test 53: OK (131071)
*** Test 54: OK (2047)
@ -53,13 +37,6 @@ Results of test49.vim:
*** Test 66: OK (5464)
*** Test 67: OK (212514423)
*** Test 68: OK (212514423)
*** Test 69: OK (8995471)
*** Test 70: OK (69544277)
*** Test 71: OK (34886997)
*** Test 72: OK (1789569365)
*** Test 73: OK (9032615)
*** Test 74: OK (224907669)
*** Test 75: OK (2000403408)
*** Test 76: OK (1610087935)
*** Test 77: OK (1388671)
*** Test 78: OK (134217728)
@ -72,11 +49,6 @@ Results of test49.vim:
*** Test 85: OK (198689)
--- Test 86: No Crash for vimgrep on BufUnload
*** Test 86: OK (0)
--- Test 87: 3
--- Test 87: 5
--- Test 87: abcdefghijk
--- Test 87: Successfully executed funcref Add2
*** Test 87: OK (0)
--- Test 88: All tests were run with throwing exceptions on error.
The $VIMNOERRTHROW control is not configured.
--- Test 88: All tests were run with throwing exceptions on interrupt.

File diff suppressed because it is too large Load Diff

View File

@ -109,7 +109,7 @@ func Test_define_script_var_with_lock()
unlet s:x
endfunc
func Test_descructuring_with_lock()
func Test_destructuring_with_lock()
const [a, b, c] = [1, 1.1, 'vim']
call assert_fails('let a = 1', 'E741:')

View File

@ -1744,7 +1744,7 @@ func Test_switchbuf()
call assert_equal(1, bufwinnr('Xqftestfile3'))
" If only quickfix window is open in the current tabpage, jumping to an
" entry with 'switchubf' set to 'usetab' should search in other tabpages.
" entry with 'switchbuf' set to 'usetab' should search in other tabpages.
enew | only
set switchbuf=usetab
tabedit Xqftestfile1

View File

@ -270,7 +270,7 @@ func Test_search_cmdline2()
" nor "/foo\<c-u>\<cr>" works to delete the commandline.
" In that case Vim should return "E35 no previous regular expression",
" but it looks like Vim still sees /foo and therefore the test fails.
" Therefore, disableing this test
" Therefore, disabling this test
"call assert_fails(feedkeys("/foo\<c-w>\<cr>", 'tx'), 'E35')
"call assert_equal({'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, winsaveview())

View File

@ -3,7 +3,7 @@
source shared.vim
source check.vim
function! Test_System()
func Test_System()
if !executable('echo') || !executable('cat') || !executable('wc')
return
endif

View File

@ -58,7 +58,7 @@ function Test_tabpage()
q
"
"
" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
" Test for ":tab drop multi-opened-file" to keep current tabpage and window.
new test1
tabnew
new test1

File diff suppressed because it is too large Load Diff

View File

@ -919,9 +919,203 @@ func Test_if_bar_fail()
call assert_equal('acdfh-acfh', g:test15_result)
endfunc
"-------------------------------------------------------------------------------
" Test 16: Double :else or :elseif after :else {{{1
"
" Multiple :elses or an :elseif after an :else are forbidden.
"-------------------------------------------------------------------------------
func T16_F() abort
if 0
Xpath 'a'
else
Xpath 'b'
else " aborts function
Xpath 'c'
endif
Xpath 'd'
endfunc
func T16_G() abort
if 0
Xpath 'a'
else
Xpath 'b'
elseif 1 " aborts function
Xpath 'c'
else
Xpath 'd'
endif
Xpath 'e'
endfunc
func T16_H() abort
if 0
Xpath 'a'
elseif 0
Xpath 'b'
else
Xpath 'c'
else " aborts function
Xpath 'd'
endif
Xpath 'e'
endfunc
func T16_I() abort
if 0
Xpath 'a'
elseif 0
Xpath 'b'
else
Xpath 'c'
elseif 1 " aborts function
Xpath 'd'
else
Xpath 'e'
endif
Xpath 'f'
endfunc
func Test_Multi_Else()
XpathINIT
try
call T16_F()
catch /E583:/
Xpath 'e'
endtry
call assert_equal('be', g:Xpath)
XpathINIT
try
call T16_G()
catch /E584:/
Xpath 'f'
endtry
call assert_equal('bf', g:Xpath)
XpathINIT
try
call T16_H()
catch /E583:/
Xpath 'f'
endtry
call assert_equal('cf', g:Xpath)
XpathINIT
try
call T16_I()
catch /E584:/
Xpath 'g'
endtry
call assert_equal('cg', g:Xpath)
endfunc
"-------------------------------------------------------------------------------
" Test 16: Recognizing {} in variable name. {{{1
" Test 17: Nesting of unmatched :if or :endif inside a :while {{{1
"
" The :while/:endwhile takes precedence in nesting over an unclosed
" :if or an unopened :endif.
"-------------------------------------------------------------------------------
" While loops inside a function are continued on error.
func T17_F()
let loops = 3
while loops > 0
let loops -= 1
Xpath 'a' . loops
if (loops == 1)
Xpath 'b' . loops
continue
elseif (loops == 0)
Xpath 'c' . loops
break
elseif 1
Xpath 'd' . loops
" endif missing!
endwhile " :endwhile after :if 1
Xpath 'e'
endfunc
func T17_G()
let loops = 2
while loops > 0
let loops -= 1
Xpath 'a' . loops
if 0
Xpath 'b' . loops
" endif missing
endwhile " :endwhile after :if 0
endfunc
func T17_H()
let loops = 2
while loops > 0
let loops -= 1
Xpath 'a' . loops
" if missing!
endif " :endif without :if in while
Xpath 'b' . loops
endwhile
endfunc
" Error continuation outside a function is at the outermost :endwhile or :endif.
XpathINIT
let v:errmsg = ''
let loops = 2
while loops > 0
let loops -= 1
Xpath 'a' . loops
if 0
Xpath 'b' . loops
" endif missing! Following :endwhile fails.
endwhile | Xpath 'c'
Xpath 'd'
call assert_match('E171:', v:errmsg)
call assert_equal('a1d', g:Xpath)
func Test_unmatched_if_in_while()
XpathINIT
call assert_fails('call T17_F()', 'E171:')
call assert_equal('a2d2a1b1a0c0e', g:Xpath)
XpathINIT
call assert_fails('call T17_G()', 'E171:')
call assert_equal('a1a0', g:Xpath)
XpathINIT
call assert_fails('call T17_H()', 'E580:')
call assert_equal('a1b1a0b0', g:Xpath)
endfunc
"-------------------------------------------------------------------------------
"-------------------------------------------------------------------------------
"-------------------------------------------------------------------------------
" Test 87 using (expr) ? funcref : funcref {{{1
"
" Vim needs to correctly parse the funcref and even when it does
" not execute the funcref, it needs to consume the trailing ()
"-------------------------------------------------------------------------------
func Add2(x1, x2)
return a:x1 + a:x2
endfu
func GetStr()
return "abcdefghijklmnopqrstuvwxyp"
endfu
func Test_funcref_with_condexpr()
call assert_equal(5, function('Add2')(2,3))
call assert_equal(3, 1 ? function('Add2')(1,2) : function('Add2')(2,3))
call assert_equal(5, 0 ? function('Add2')(1,2) : function('Add2')(2,3))
" Make sure, GetStr() still works.
call assert_equal('abcdefghijk', GetStr()[0:10])
endfunc
"-------------------------------------------------------------------------------
" Test 90: Recognizing {} in variable name. {{{1
"-------------------------------------------------------------------------------
func Test_curlies()
@ -1490,5 +1684,5 @@ endfunc
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=4 tw=80 fdm=marker
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
"-------------------------------------------------------------------------------