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
|
endfunc
|
||||||
|
|
||||||
func Test_expand_star_star()
|
func Test_expand_star_star()
|
||||||
call mkdir('a/b', 'pR')
|
call mkdir('a/b/c', 'pR')
|
||||||
call writefile(['asdfasdf'], 'a/b/fileXname')
|
call writefile(['asdfasdf'], 'a/b/c/fileXname')
|
||||||
call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt')
|
call feedkeys(":find a/**/fileXname\<Tab>\<CR>", 'xt')
|
||||||
call assert_equal('find a/b/fileXname', @:)
|
call assert_equal('find a/b/c/fileXname', @:)
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
def Test_source_files()
|
def Test_source_files()
|
||||||
for fname in glob('../*.[ch]', 0, 1)
|
for fname in glob('../*.[ch]', 0, 1)
|
||||||
|
bwipe!
|
||||||
exe 'edit ' .. fname
|
exe 'edit ' .. fname
|
||||||
|
|
||||||
cursor(1, 1)
|
cursor(1, 1)
|
||||||
@ -26,11 +27,11 @@ def Test_source_files()
|
|||||||
lnum = search(')\s*{', '', 0, 0, skip)
|
lnum = search(')\s*{', '', 0, 0, skip)
|
||||||
assert_equal(0, lnum, fname .. ': curly after closing paren')
|
assert_equal(0, lnum, fname .. ': curly after closing paren')
|
||||||
|
|
||||||
cursor(1, 1)
|
|
||||||
# Examples in comments use double quotes.
|
# Examples in comments use double quotes.
|
||||||
skip = "getline('.') =~ '\"'"
|
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"')
|
assert_equal(0, lnum, fname .. ': curly before "else"')
|
||||||
|
|
||||||
cursor(1, 1)
|
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'],
|
\ 'bzl': ['file.BUILD', 'BUILD'],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
func CheckItems(checks)
|
def CheckItems(checks: dict<list<string>>)
|
||||||
set noswapfile
|
set noswapfile
|
||||||
for [ft, names] in items(a:checks)
|
|
||||||
|
for [ft, names] in items(checks)
|
||||||
for i in range(0, len(names) - 1)
|
for i in range(0, len(names) - 1)
|
||||||
new
|
new
|
||||||
try
|
try
|
||||||
exe 'edit ' . fnameescape(names[i])
|
exe 'edit ' .. fnameescape(names[i])
|
||||||
catch
|
catch
|
||||||
call assert_report('cannot edit "' . names[i] . '": ' . v:exception)
|
assert_report('cannot edit "' .. names[i] .. '": ' .. v:exception)
|
||||||
endtry
|
endtry
|
||||||
if &filetype == '' && &readonly
|
if &filetype == '' && &readonly
|
||||||
" File exists but not able to edit it (permission denied)
|
# File exists but not able to edit it (permission denied)
|
||||||
else
|
else
|
||||||
let expected = ft == 'none' ? '' : ft
|
var expected = ft == 'none' ? '' : ft
|
||||||
call assert_equal(expected, &filetype, 'with file name: ' . names[i])
|
assert_equal(expected, &filetype, 'with file name: ' .. names[i])
|
||||||
endif
|
endif
|
||||||
bwipe!
|
bwipe!
|
||||||
endfor
|
endfor
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
set swapfile&
|
set swapfile&
|
||||||
endfunc
|
enddef
|
||||||
|
|
||||||
func Test_filetype_detection()
|
func Test_filetype_detection()
|
||||||
filetype on
|
filetype on
|
||||||
|
|||||||
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1570,
|
||||||
/**/
|
/**/
|
||||||
1569,
|
1569,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user