patch 9.0.1570: some tests are slow
Problem: Some tests are slow. Solution: Make a few test cases faster.
This commit is contained in:
@ -791,10 +791,10 @@ func Test_shellcmd_completion()
|
||||
endfunc
|
||||
|
||||
func Test_expand_star_star()
|
||||
call mkdir('a/b', 'pR')
|
||||
call writefile(['asdfasdf'], 'a/b/fileXname')
|
||||
call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt')
|
||||
call assert_equal('find a/b/fileXname', @:)
|
||||
call mkdir('a/b/c', 'pR')
|
||||
call writefile(['asdfasdf'], 'a/b/c/fileXname')
|
||||
call feedkeys(":find a/**/fileXname\<Tab>\<CR>", 'xt')
|
||||
call assert_equal('find a/b/c/fileXname', @:)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
def Test_source_files()
|
||||
for fname in glob('../*.[ch]', 0, 1)
|
||||
bwipe!
|
||||
exe 'edit ' .. fname
|
||||
|
||||
cursor(1, 1)
|
||||
@ -26,11 +27,11 @@ def Test_source_files()
|
||||
lnum = search(')\s*{', '', 0, 0, skip)
|
||||
assert_equal(0, lnum, fname .. ': curly after closing paren')
|
||||
|
||||
cursor(1, 1)
|
||||
# Examples in comments use double quotes.
|
||||
skip = "getline('.') =~ '\"'"
|
||||
# Avoid examples that contain: "} else
|
||||
lnum = search('[^"]}\s*else', '', 0, 0, skip)
|
||||
|
||||
cursor(1, 1)
|
||||
lnum = search('}\s*else', '', 0, 0, skip)
|
||||
assert_equal(0, lnum, fname .. ': curly before "else"')
|
||||
|
||||
cursor(1, 1)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -704,27 +704,29 @@ let s:filename_case_checks = {
|
||||
\ 'bzl': ['file.BUILD', 'BUILD'],
|
||||
\ }
|
||||
|
||||
func CheckItems(checks)
|
||||
def CheckItems(checks: dict<list<string>>)
|
||||
set noswapfile
|
||||
for [ft, names] in items(a:checks)
|
||||
|
||||
for [ft, names] in items(checks)
|
||||
for i in range(0, len(names) - 1)
|
||||
new
|
||||
try
|
||||
exe 'edit ' . fnameescape(names[i])
|
||||
exe 'edit ' .. fnameescape(names[i])
|
||||
catch
|
||||
call assert_report('cannot edit "' . names[i] . '": ' . v:exception)
|
||||
assert_report('cannot edit "' .. names[i] .. '": ' .. v:exception)
|
||||
endtry
|
||||
if &filetype == '' && &readonly
|
||||
" File exists but not able to edit it (permission denied)
|
||||
# File exists but not able to edit it (permission denied)
|
||||
else
|
||||
let expected = ft == 'none' ? '' : ft
|
||||
call assert_equal(expected, &filetype, 'with file name: ' . names[i])
|
||||
var expected = ft == 'none' ? '' : ft
|
||||
assert_equal(expected, &filetype, 'with file name: ' .. names[i])
|
||||
endif
|
||||
bwipe!
|
||||
endfor
|
||||
endfor
|
||||
|
||||
set swapfile&
|
||||
endfunc
|
||||
enddef
|
||||
|
||||
func Test_filetype_detection()
|
||||
filetype on
|
||||
|
||||
@ -695,6 +695,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1570,
|
||||
/**/
|
||||
1569,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user