comparison src/testdir/test_filetype.vim @ 29427:2830faa3e100 v9.0.0055

patch 9.0.0055: bitbake files are not detected Commit: https://github.com/vim/vim/commit/fa49eb482729a5fe7da9c9a5ed8d14f68afa55c7 Author: Gregory Anders <greg@gpanders.com> Date: Sat Jul 16 17:46:47 2022 +0100 patch 9.0.0055: bitbake files are not detected Problem: Bitbake files are not detected. Solution: Add bitbake filetype detection by file name and contents. (Gregory Anders, closes #10697)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Jul 2022 19:00:07 +0200
parents 87174e9f7529
children 27ebab59172e
comparison
equal deleted inserted replaced
29426:da62efc02e4f 29427:2830faa3e100
81 \ 'bdf': ['file.bdf'], 81 \ 'bdf': ['file.bdf'],
82 \ 'beancount': ['file.beancount'], 82 \ 'beancount': ['file.beancount'],
83 \ 'bib': ['file.bib'], 83 \ 'bib': ['file.bib'],
84 \ 'bicep': ['file.bicep'], 84 \ 'bicep': ['file.bicep'],
85 \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'], 85 \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'],
86 \ 'bitbake': ['file.bb', 'file.bbappend', 'file.bbclass', 'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 'meta-layer/conf/distro/foo.conf'],
86 \ 'blank': ['file.bl'], 87 \ 'blank': ['file.bl'],
87 \ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'], 88 \ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'],
88 \ 'bst': ['file.bst'], 89 \ 'bst': ['file.bst'],
89 \ 'bzl': ['file.bazel', 'file.bzl', 'WORKSPACE'], 90 \ 'bzl': ['file.bazel', 'file.bzl', 'WORKSPACE'],
90 \ 'bzr': ['bzr_log.any', 'bzr_log.file'], 91 \ 'bzr': ['bzr_log.any', 'bzr_log.file'],
1814 1815
1815 call delete('Xfile.sig') 1816 call delete('Xfile.sig')
1816 filetype off 1817 filetype off
1817 endfunc 1818 endfunc
1818 1819
1820 func Test_inc_file()
1821 filetype on
1822
1823 call writefile(['this is the fallback'], 'Xfile.inc')
1824 split Xfile.inc
1825 call assert_equal('pov', &filetype)
1826 bwipe!
1827
1828 let g:filetype_inc = 'foo'
1829 split Xfile.inc
1830 call assert_equal('foo', &filetype)
1831 bwipe!
1832 unlet g:filetype_inc
1833
1834 " aspperl
1835 call writefile(['perlscript'], 'Xfile.inc')
1836 split Xfile.inc
1837 call assert_equal('aspperl', &filetype)
1838 bwipe!
1839
1840 " aspvbs
1841 call writefile(['<% something'], 'Xfile.inc')
1842 split Xfile.inc
1843 call assert_equal('aspvbs', &filetype)
1844 bwipe!
1845
1846 " php
1847 call writefile(['<?php'], 'Xfile.inc')
1848 split Xfile.inc
1849 call assert_equal('php', &filetype)
1850 bwipe!
1851
1852 " pascal
1853 call writefile(['program'], 'Xfile.inc')
1854 split Xfile.inc
1855 call assert_equal('pascal', &filetype)
1856 bwipe!
1857
1858 " bitbake
1859 call writefile(['require foo'], 'Xfile.inc')
1860 split Xfile.inc
1861 call assert_equal('bitbake', &filetype)
1862 bwipe!
1863
1864 " asm
1865 call writefile(['asmsyntax=foo'], 'Xfile.inc')
1866 split Xfile.inc
1867 call assert_equal('foo', &filetype)
1868 bwipe!
1869
1870 call delete('Xfile.inc')
1871 filetype off
1872 endfunc
1819 1873
1820 " vim: shiftwidth=2 sts=2 expandtab 1874 " vim: shiftwidth=2 sts=2 expandtab