Mercurial > vim
annotate src/testdir/test_filetype.vim @ 11766:6315c631dcb7 v8.0.0765
patch 8.0.0765: build fails with tiny features
commit https://github.com/vim/vim/commit/81bdd6a02575b024db3dd5d91ec4ac4dfd41aa7a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 23 22:57:00 2017 +0200
patch 8.0.0765: build fails with tiny features
Problem: Build fails with tiny features.
Solution: Adjust #ifdef. (John Marriott)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 23 Jul 2017 23:00:05 +0200 |
parents | 561b76ed9d12 |
children | c2aa4af29251 |
rev | line source |
---|---|
11459
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test :setfiletype |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_detection() |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 filetype on |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 augroup filetypedetect |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 au BufNewFile,BufRead * call assert_equal(1, did_filetype()) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 augroup END |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 new something.vim |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call assert_equal('vim', &filetype) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 bwipe! |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 filetype off |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 endfunc |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 func Test_conf_type() |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 filetype on |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call writefile(['# some comment', 'must be conf'], 'Xfile') |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 augroup filetypedetect |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 au BufNewFile,BufRead * call assert_equal(0, did_filetype()) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 augroup END |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 split Xfile |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal('conf', &filetype) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 bwipe! |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call delete('Xfile') |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 filetype off |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 endfunc |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 func Test_other_type() |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 filetype on |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 augroup filetypedetect |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 au BufNewFile,BufRead * call assert_equal(0, did_filetype()) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 au BufNewFile,BufRead Xfile setf testfile |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 au BufNewFile,BufRead * call assert_equal(1, did_filetype()) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 augroup END |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 call writefile(['# some comment', 'must be conf'], 'Xfile') |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 split Xfile |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 call assert_equal('testfile', &filetype) |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 bwipe! |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call delete('Xfile') |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 filetype off |
561b76ed9d12
patch 8.0.0613: the conf filetype is used before ftdetect from packages
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 endfunc |