From 080b8cdc603b059db2d9e6f56e3f724418f9366a Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 25 Aug 2020 14:26:38 +0200 Subject: Fix ansible ftdetect --- scripts/test_extensions.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/test_extensions.vim (limited to 'scripts/test_extensions.vim') diff --git a/scripts/test_extensions.vim b/scripts/test_extensions.vim new file mode 100644 index 00000000..aea52f94 --- /dev/null +++ b/scripts/test_extensions.vim @@ -0,0 +1,14 @@ +function! TestExtension(filetype, filename, content) + try + exec "e " . a:filename + exec "if &filetype != '" . a:filetype . "' \nthrow &filetype\nendif" + catch + echo 'Filename "' . a:filename . '" does not resolve to extension "' . a:filetype . '"' + echo ' instead received: "' . v:exception . '"' + exec ':cq!' + endtry +endfunction + +call TestExtension('blade', 'test.blade.php', '') +call TestExtension('yaml.ansible', 'playbook.yml', '') +call TestExtension('yaml.ansible', 'host_vars/foobar', '') -- cgit v1.2.3