mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
patch 8.2.4714: using g:filetype_dat and g:filetype_src not tested
Problem: Using g:filetype_dat and g:filetype_src not tested. Solution: Add a test. (Patrick Meiser-Knosowski, closes #10117)
This commit is contained in:
parent
0937182d49
commit
a8034a4886
@ -873,22 +873,32 @@ endfunc
|
|||||||
func Test_dat_file()
|
func Test_dat_file()
|
||||||
filetype on
|
filetype on
|
||||||
|
|
||||||
|
" KRL header start with "&WORD", but is not always present.
|
||||||
call writefile(['&ACCESS'], 'datfile.dat')
|
call writefile(['&ACCESS'], 'datfile.dat')
|
||||||
split datfile.dat
|
split datfile.dat
|
||||||
call assert_equal('krl', &filetype)
|
call assert_equal('krl', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
call delete('datfile.dat')
|
call delete('datfile.dat')
|
||||||
|
|
||||||
|
" KRL defdat with leading spaces, for KRL file extension is not case
|
||||||
|
" sensitive.
|
||||||
call writefile([' DEFDAT datfile'], 'datfile.Dat')
|
call writefile([' DEFDAT datfile'], 'datfile.Dat')
|
||||||
split datfile.Dat
|
split datfile.Dat
|
||||||
call assert_equal('krl', &filetype)
|
call assert_equal('krl', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
call delete('datfile.Dat')
|
call delete('datfile.Dat')
|
||||||
|
|
||||||
call writefile(['', 'defdat datfile'], 'datfile.DAT')
|
" KRL defdat with embedded spaces, file starts with empty line(s).
|
||||||
|
call writefile(['', 'defdat datfile public'], 'datfile.DAT')
|
||||||
split datfile.DAT
|
split datfile.DAT
|
||||||
call assert_equal('krl', &filetype)
|
call assert_equal('krl', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
|
" User may overrule file inspection
|
||||||
|
let g:filetype_dat = 'dat'
|
||||||
|
split datfile.DAT
|
||||||
|
call assert_equal('dat', &filetype)
|
||||||
|
bwipe!
|
||||||
call delete('datfile.DAT')
|
call delete('datfile.DAT')
|
||||||
|
|
||||||
filetype off
|
filetype off
|
||||||
@ -1339,22 +1349,31 @@ endfunc
|
|||||||
func Test_src_file()
|
func Test_src_file()
|
||||||
filetype on
|
filetype on
|
||||||
|
|
||||||
|
" KRL header start with "&WORD", but is not always present.
|
||||||
call writefile(['&ACCESS'], 'srcfile.src')
|
call writefile(['&ACCESS'], 'srcfile.src')
|
||||||
split srcfile.src
|
split srcfile.src
|
||||||
call assert_equal('krl', &filetype)
|
call assert_equal('krl', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
call delete('srcfile.src')
|
call delete('srcfile.src')
|
||||||
|
|
||||||
|
" KRL def with leading spaces, for KRL file extension is not case sensitive.
|
||||||
call writefile([' DEF srcfile()'], 'srcfile.Src')
|
call writefile([' DEF srcfile()'], 'srcfile.Src')
|
||||||
split srcfile.Src
|
split srcfile.Src
|
||||||
call assert_equal('krl', &filetype)
|
call assert_equal('krl', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
call delete('srcfile.Src')
|
call delete('srcfile.Src')
|
||||||
|
|
||||||
|
" KRL global def with embedded spaces, file starts with empty line(s).
|
||||||
call writefile(['', 'global def srcfile()'], 'srcfile.SRC')
|
call writefile(['', 'global def srcfile()'], 'srcfile.SRC')
|
||||||
split srcfile.SRC
|
split srcfile.SRC
|
||||||
call assert_equal('krl', &filetype)
|
call assert_equal('krl', &filetype)
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
|
" User may overrule file inspection
|
||||||
|
let g:filetype_src = 'src'
|
||||||
|
split srcfile.SRC
|
||||||
|
call assert_equal('src', &filetype)
|
||||||
|
bwipe!
|
||||||
call delete('srcfile.SRC')
|
call delete('srcfile.SRC')
|
||||||
|
|
||||||
filetype off
|
filetype off
|
||||||
|
@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
4714,
|
||||||
/**/
|
/**/
|
||||||
4713,
|
4713,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user