aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGaƩtan Lepage <33058747+GaetanLepage@users.noreply.github.com>2023-05-11 09:43:02 +0200
committerGitHub <noreply@github.com>2023-05-11 15:43:02 +0800
commite90b506903babc84f8c5b796c3b25c7f20e183d2 (patch)
tree64bf8a3b9107af2d2b9710f821faf05981932de8 /test
parent9d306ac6b79c13b5f42ea4e22c6f8ccc628f6a6a (diff)
downloadrneovim-e90b506903babc84f8c5b796c3b25c7f20e183d2.tar.gz
rneovim-e90b506903babc84f8c5b796c3b25c7f20e183d2.tar.bz2
rneovim-e90b506903babc84f8c5b796c3b25c7f20e183d2.zip
vim-patch:9.0.1539: typst filetype is not recognized (#23578)
Problem: Typst filetype is not recognized. Solution: Distinguish between sql and typst. (Gaetan Lepage, closes vim/vim#12363) https://github.com/vim/vim/commit/4ce1bda869e4ec0152d7dcbe1e491ceac5341d5e
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_filetype.vim33
1 files changed, 32 insertions, 1 deletions
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index 2d7a24090f..177a8247ac 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -564,7 +564,7 @@ let s:filename_checks = {
\ 'spice': ['file.sp', 'file.spice'],
\ 'spup': ['file.speedup', 'file.spdata', 'file.spd'],
\ 'spyce': ['file.spy', 'file.spi'],
- \ 'sql': ['file.tyb', 'file.typ', 'file.tyc', 'file.pkb', 'file.pks'],
+ \ 'sql': ['file.tyb', 'file.tyc', 'file.pkb', 'file.pks'],
\ 'sqlj': ['file.sqlj'],
\ 'prql': ['file.prql'],
\ 'sqr': ['file.sqr', 'file.sqi'],
@@ -2047,4 +2047,35 @@ func Test_lsl_file()
filetype off
endfunc
+func Test_typ_file()
+ filetype on
+
+ " SQL type file
+
+ call writefile(['CASE = LOWER'], 'Xfile.typ', 'D')
+ split Xfile.typ
+ call assert_equal('sql', &filetype)
+ bwipe!
+
+ call writefile(['TYPE foo'], 'Xfile.typ')
+ split Xfile.typ
+ call assert_equal('sql', &filetype)
+ bwipe!
+
+ " typst document
+
+ call writefile(['this is a fallback'], 'Xfile.typ')
+ split Xfile.typ
+ call assert_equal('typst', &filetype)
+ bwipe!
+
+ let g:filetype_typ = 'typst'
+ split test.typ
+ call assert_equal('typst', &filetype)
+ bwipe!
+ unlet g:filetype_typ
+
+ filetype off
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab