diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-10 21:32:33 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-04-11 18:38:42 +0800 |
commit | 18ed556bbd95a7d3d925432e71c33dcfc6bf47b8 (patch) | |
tree | 3371eeb16b7ca1c29d4ebbf9388312414905d9c5 | |
parent | 8f95f3ea0612d1887f68c9663ee6bc831168a04e (diff) | |
download | rneovim-18ed556bbd95a7d3d925432e71c33dcfc6bf47b8.tar.gz rneovim-18ed556bbd95a7d3d925432e71c33dcfc6bf47b8.tar.bz2 rneovim-18ed556bbd95a7d3d925432e71c33dcfc6bf47b8.zip |
vim-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 vim/vim#10117)
https://github.com/vim/vim/commit/a8034a4886843fbf10bd59a6f55ec723da515b8e
-rw-r--r-- | src/nvim/testdir/test_filetype.vim | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 1f6d2ce198..fbf02989ea 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -875,22 +875,32 @@ endfunc func Test_dat_file() filetype on + " KRL header start with "&WORD", but is not always present. call writefile(['&ACCESS'], 'datfile.dat') split datfile.dat call assert_equal('krl', &filetype) bwipe! call delete('datfile.dat') + " KRL defdat with leading spaces, for KRL file extension is not case + " sensitive. call writefile([' DEFDAT datfile'], 'datfile.Dat') split datfile.Dat call assert_equal('krl', &filetype) bwipe! 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 call assert_equal('krl', &filetype) bwipe! + + " User may overrule file inspection + let g:filetype_dat = 'dat' + split datfile.DAT + call assert_equal('dat', &filetype) + bwipe! call delete('datfile.DAT') filetype off @@ -1460,22 +1470,31 @@ endfunc func Test_src_file() filetype on + " KRL header start with "&WORD", but is not always present. call writefile(['&ACCESS'], 'srcfile.src') split srcfile.src call assert_equal('krl', &filetype) bwipe! call delete('srcfile.src') + " KRL def with leading spaces, for KRL file extension is not case sensitive. call writefile([' DEF srcfile()'], 'srcfile.Src') split srcfile.Src call assert_equal('krl', &filetype) bwipe! call delete('srcfile.Src') + " KRL global def with embedded spaces, file starts with empty line(s). call writefile(['', 'global def srcfile()'], 'srcfile.SRC') split srcfile.SRC call assert_equal('krl', &filetype) bwipe! + + " User may overrule file inspection + let g:filetype_src = 'src' + split srcfile.SRC + call assert_equal('src', &filetype) + bwipe! call delete('srcfile.SRC') filetype off |